Problem/Motivation

We have something like 10 content types and ~150 other bundles. Around 120 of the entity/bundle from the whole list are translated.

Once we are at that point the page for management what content gets translated located on admin/config/regional/content-language gets progressively slower current form submission is processed in 50-60 seconds (tracking by browser response time).

Proposed resolution

I think a refactoring is needed to have this single page UI separated to a multi-page solution.

Page 1 - have the content types enabled / disabled with links for the enabled ones to page 2.
Page 2 - have the list of bundles of the entity type just listed on a dedicated page with action links for each.
Page 3 - have a dedicated page to handle single entity/bundle multilingual settings in a small form.

Maybe change the link from field UI that suggest enabling translation to the correct bundle management page (3).

Remaining tasks

Discussion, direction, patch.

User interface changes

TBD. Depends based on the discussion.

API changes

None expected - only UI changes...
Maybe add couple of new forms.

Data model changes

None expected - same config entities.

Release notes snippet

TBD.

Comments

ndobromirov created an issue. See original summary.

ndobromirov’s picture

Issue summary: View changes
berdir’s picture

Component: transliteration system » content_translation.module

I agree it's too big, while that's a huge amount of bundles, it already gets very slow with a lot less.

The problem is that it's not just one form. It's a pretty simple form defined by language module that just has a bunch of settings per bundle and then content_translation comes and alters the hell out of it. So the form structure kind of *is* the API between those two modules. And I know that e.g. paragraphs and possibly other modules then also alter it. So not quite sure how to untangle it..

Per bundle enable/disable is already possible for common bundles in their settings page, maybe we could expand on that and add a local task similar to field UI that allows to manage per-field translation settings?

larowlan’s picture

Status: Active » Needs review
StatusFileSize
new2.68 KB

What if we use a batch callback instead?

Status: Needs review » Needs work

The last submitted patch, 4: 3027607-timeout.patch, failed testing. View results

berdir’s picture

Interesting idea, we can try that, but the slow part is in content_translation.module in submit function, that's what we'd need to batch :)

larowlan’s picture

Ah, so adding a batch_set call in content_translation_form_language_content_settings_submit instead..gotcha

ndobromirov’s picture

Yeah but this is still breaking the site building UX...

Imagine the case - I want to add couple of new bundles and enable translations on them...

In that case I need to go in there add 1 bundle and go in translation UI enable and configure it there - wait 2 minutes for batch to finish.
Add the other one and wait 2 minutes for batch to finish.

In my proposal (even if it's a much more comples implementation) it will be go and configure the translation for the 2 exact bundles and save 2 small forms for each (way under a minute worth of time)

This was my assumption in the proposal. I get the idea that a batch operation will resolve the time-outs, but they will not resolve the wait time :( that is an awful UX in general.

berdir’s picture

Sure, having what you suggest would be better for many cases, but it would likely also not replace this but just add another per-bundle form. It's also likely more work to get done.

The second thing to investigate would be to make sure that we only save things if they actually changed. If we do that, it shouldn't matter *a lot* that you have 100 bundles, if you only 10 fields or 3 bundles changed.

ndobromirov’s picture

Unless you hit the PHP's limit on max_input_vars at some point that defaults to 1000 and then you can not submit the form at all...

Maybe change the UI to have per-bundle form, so not a single submit in the bottom but a submit per bundle.
Not liking the idea - the for is still going to be too big to navigate sanely in it.

ndobromirov’s picture

Per bundle enable/disable is already possible for common bundles in their settings page, maybe we could expand on that and add a local task similar to field UI that allows to manage per-field translation settings?

Big +1 :).

I like this one a lot, so no longer will be needed to leave the bundle settings UI. This can be an addition over the currently slow one that can take over it's role in near future.

ghost of drupal past’s picture

For other people running into this issue, I posted a quick and dirty workaround module to https://gist.github.com/chx/d63ed7405b47255a0d4481d60dd33641 don't forget to weigh it to 11, at least here content translation is 10. It's quick and very dirty but it does solve our problem where we already hit the input vars limit.

wim leers’s picture

Title: Submitting the form on admin/config/regional/content-language times out. » Submitting the form on admin/config/regional/content-language times out because it is enormous
Version: 8.6.x-dev » 8.8.x-dev
Issue tags: +Usability

Hah!

@Charlie ChX Negyesi had opened #3076506: The custom language settings form does not scale, to which I responded at #3076506-2: The custom language settings form does not scale:

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.

… which is pretty much exactly what the issue summary here is proposing! 🥳

wim leers’s picture

berdir’s picture

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

Entity types, Drupal 6? :)

No, this is all new in D8, nothing like it existed before. *but* as I commented above, the complexity comes from the fact that it is split in two modules. The language module provides *only* the entity type + bundle-level setting, that scales fairly well. Only when you also enable content_translation then you get the vast list of per-field-per-bundle checkboxes. Those two things were added at different times, and both pretty early in the D8 lifecycle.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

joachim’s picture

Issue tags: +Needs issue rescope

If #3076506: The custom language settings form does not scale is closed as a duplicate of this one, then this one needs rescoping to be about UX as well as performance.

joachim’s picture

I think the form needs breaking up, as mentioned above. Which is going to be complicated, as also mentioned.

But a really quick fix that would go some way towards making it more usable in the meantime would be to change the container elements for each entity type to collapsed details elements. I'll file a child issue for that.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

duaelfr’s picture

@Berdir #15 > The language module provides *only* the entity type + bundle-level setting, that scales fairly well. Only when you also enable content_translation then you get the vast list of per-field-per-bundle checkboxes. Those two things were added at different times, and both pretty early in the D8 lifecycle.

What if we only changed the bit added by content_translation to only add links/buttons in this form leading to a specific page for each entity type? I think we don't even need to split it to a page per bundle to begin with (could be done in a follow up).

banoodle’s picture

StatusFileSize
new107.64 KB

@duaelfr I like this idea. It is similar to how domain_entity module handles things.

screenshot of domain entity user interface

This feature would really help me out ; )

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.