Admin/Edit+ Content templates & related asset metadata fields


(Dave Lang) #1

Matrix Version: 5.4.0.3

I’ve run into an issue where Matrix doesn’t save changes correctly once page hits a certain number of inputs.

We’re currently building pages using a content template driven panel style layout, you can see examples on QUT’s research section. Each panel is a separate content template with metadata fields to define background colours, padding and more. Some of these incorporate subcontent WYSIWYG’s for each tile, box or content element.

After adding around 10 of these panels I’ve found that the page stops saving any input past a certain point, a bit of experimentation narrowed it down to approx. the 850th(!) field in the POST.

Most of these fields are empty inputs, related asset metadata fields working out to 9-10 inputs, even if they’re set to default/empty. Many of these fields are only needed for the UI. This seems excessive, using a bit of back of the napkin math:

10 inputs * 8 panels * 8 related fields (title link, content link & 1 per box in a panel) = 640 inputs, the source of most of the issue.

I’m currently working around it by disabling fields that aren’t needed via JS loaded in the Simple Edit Layout, but is there a way to optimise these properly on the matrix end?


(Bart Banda) #2

Probably due to the default max_input_vars in php.ini being set to 1000, which means PHP by default allows 1000 $_POST variables to be loaded before further variables are ignored (as a security measure).

The only way around it is to either increase that setting on the server, or change your implementation around a bit so that less fields are somehow used?


(Dave Lang) #3

You’re right, it’s probably PHP although it does seem to be right on 850 fields, not the 1000 default.

Our current implementation seems reasonable, although probably more than the content templates were intended for. I’m currently disabling all the unneeded fields at commit time and it works correctly.

Is it really necessary for Squiz to send the ‘Change’, ‘Reset’ and ‘Clear’ buttons, along with the link type, url, asset name, type code & an extra copy of the assetid for each field?

EDIT: Actually, my mistake, it’s not sending through the buttons.