Problem/Motivation

We have some 606 `field.field` entities mostly across the 18 node types and 85 paragraph types. The admin/config/regional/content-language form exceeds the default 1000 max_input_vars setting and after raising it, saving takes forever.

Proposed resolution

Diff the changes in the form and avoid loading and checking all the unchanged fields. In an ideal world, diff on client side in JS.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Comments

Charlie ChX Negyesi created an issue. See original summary.

wim leers’s picture

I suspect this form was designed in Drupal 6 times, when having so many entity types and/or bundles was unheard of.

More importantly, it also uses a pretty odd design pattern (arguably, no existing design pattern): checking a checkbox for an entity type reveals a huge form for that particular entity type. (Screenshots attached.)

Wouldn't the more elegant way to fix this be to just improve usability and as a side effect fix this scalability problem? I'm thinking vertical tabs, local tasks or something else still.

mikelutz’s picture

I haven't hit the max input vars limit, but the form is extremely unwieldy, takes a long time to load and save, And I really hate going in there. Could we just break the form up by entity type and bundle?

ghost of drupal past’s picture

StatusFileSize
new1.83 KB

Thanks Wim. Workaround attached. Don't forget to weigh it 11, content_translation seems to be 10 here.

ghost of drupal past’s picture

StatusFileSize
new1.91 KB

Hum,, I should have pushed that into a sandbox or something ... that didn't work 100% but this one does. Same idea: all the submit/validate handlers iterate the settings array so we can just pare it down to one bundle -- except it works now. This is not a proper solution for core but it is a solution for sites like ours which can't save this form. It is also something I wrote in like an hour and all the usual disclaimers apply, there's likely an XSS security hole if you allow untrusted users to label your bundles, blah, blah. We haven't QA'd it properly yet, I will post here when we are done with that -- I fully expect this to go into production next week.

ghost of drupal past’s picture