Jump to content

Limit Input_Vars On Translations Page


Simone Salerno

Recommended Posts

I was having troubles with translations so I thought it was because of the max_input_vars php setting being too low. I'm on a VPS, so I could change it and make it higher, but I found topics about users on shared hosting who can't.

 

So I tried to limit the number of input fields to the very minimum and wrote this little snippet; you should include it in root/adminXYZ/themes/default/js/admin-theme.js:

$(function() {
	//mark inputs that need to be updated
	$('#translations_form input').on('focus', function() {
            $(this).addClass('focused');
        });
	
	$('#translations_form').on('submit', function() {
		//delete unnecessary inputs
		$('td input[type=text]:not(.focused)').detach();
	});
});

This way you only upload few ( only the ones you changed ) input vars and don't exceed the limits.

Edited by SimoneS93 (see edit history)
  • Like 2
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...