1

My Drupal 8 website is multilingual and has many entity type bundles for nodes, taxonomy terms, paragraphs, media et cetera. This leads to a content language settings form (admin/config/regional/content-language) with more than thousand translatable-checkboxes.

Currently I'm not able to save this form. In the first place the form seemed to be successful submitted but changes have not been saved. This was caused by insufficient php setting value for max_input_vars, which could be solved by setting it to 6000. Now I'm struggling with a timeout. After submitting the form the request fails after some minutes.

Here are the php settings of my Drupal VM:

php_version: "5.6"
php_memory_limit: "1024M"
php_realpath_cache_size: "1024K"
php_opcache_enabled_in_ini: true
php_opcache_memory_consumption: "192"
php_opcache_max_accelerated_files: 4096
php_max_input_vars: "6000"
php_max_execution_time: "720"
php_post_max_size: '64M'

How can I get around this issue? Which resource bottleneck could cause this?

  • How many input fields do you have on that page? With document.querySelectorAll('input').length on the Dev-Tools you will get an info about that. I have a multilingual site too with about 40 bundles. But I have more fields on the permissions settings page. On the content language configuration page I have only 454 input fields, on the permissions settings page there are 2316 input fields. The only change I made was to increase the max_input_vars to 2500. – RWAM Jan 15 '18 at 12:29
  • @RWAM: Currently there are 148 bundles listed with 1622 checkboxes. It's I quite complex website. The permission settings page is also very large but you can decrease the number of input fields by setting permissions on each role separately. – Philipp Michael Jan 15 '18 at 14:12
  • What's your value for the php setting max_input_time? Otherwise you can test to increase other settings. In my environment I use the following values: realpath_cache_size: 4096K, post_max_size: 128M, opcache.max_accelerated_files: 10000. – RWAM Jan 15 '18 at 14:58
  • How can you get around this issue? If you are desperate, you could hack core and remove array keys from $entity_types in the first line of buildForm() in core/modules/language/src/Form/ContentLanguageSettingsForm.php. – 4k4 Jan 15 '18 at 15:15
  • @RWAM: max_input_time is set to 60. I will test your suggested values and report back. – Philipp Michael Jan 15 '18 at 15:28
0

I tried the max_input_vars fix and that didnt work (i have alot of custom entities on the page and was hoping this would work). I had to check the entity, pretend it was called MyCustomEntity in 'Custom language settings' at the top... but also scroll down to the individual MyCustomEntity settings further down on the page, and also check that checkbox. When I saved, now it worked

0

Today I had to struggle again with this problem and could solve it by disabling Xdebug. So to sum up this could help:

  • increase memory_limit and max_execution_time
  • update to latest PHP version (at least 7.1)
  • make sure Xdebug is not enabled when saving the settings form (e.g. via browser extension or general xdebug settings on server/vm)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.