Currently, when using a Form Mode to Create a new Bundle able Entity , the displayed Title is:
"Create" %bundle_id "as" %form_mode_label
This is confusing for non coders (Content Managers) because it does not match the Human readable Label (good) shown on the Title when editing and existing Entity.
I have a patch, that injects the 'entity_type.bundle.info' container into `\Drupal\form_mode_manager\Controller\FormModeManagerEntityController`and then creates all Route Controllers (factories) passing that into their constructors and then alters \Drupal\form_mode_manager\AbstractEntityFormModesFactory::pageTitle
Note: The way the Abstract Class is defined requires me to pass the same container, even for controllers that are not bundle aware. But it seems to be an overkill to have two different Abstract Classes, or override the Constructor for those who don't match. Also injecting a dependency does not seem to affect performance.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | form_mode_manager-bundle-label-in-title-3100112-2-D8.patch | 7.9 KB | diegopino |
Comments
Comment #2
diegopino commentedComment #3
diegopino commentedComment #4
diegopino commentedHi Folks. Anyone could give this a look please? Thanks a lot
Comment #5
dwwI believe this is the same bug as already reported at #3069630: Page title is not translated.
That issue has a much simpler patch that I believe would achieve the same result you're looking for here.
Would you be willing to test that out for your site and see if it works?
Thanks!
-Derek