Problem/Motivation
Actually we have some cases of code duplication / complexity of code. That is due by Drupal core problemes exemple : We not have an real standard to identify the collection list pages of entities and we need to add "Bundle List" pages on each entities compatible with FormModeManager.
We have few problems with Files / User entities because theses entities not provide an "standard" entity form but have a multi step form specialy in File cases that can be problematic.
To avoid these problemes we DO provide an more robust more decoupled interfaces / manager to enhanced routes and add form_display parametter with new routes (IS THAT THE BETTER WAY TO USE Form modes).
Proposed resolution
Purpose an refactor on web/modules/contrib/form_mode_manager/src/Routing/FormModeManagerRouteSubscriber.php to simplify and clearify the route building / editing.
AFTER that refactor we can start to ADD UNIT test and switch to RC / STABLE release.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | route_alteration_refactor-2834768-5.patch | 35.29 KB | woprrr |
| #3 | route_alteration_refactor-2834768-3.patch | 32.55 KB | woprrr |
| #2 | route_alteration_refactor-2834768-2.patch | 29.27 KB | woprrr |
Comments
Comment #2
woprrr commentedFirst step of that BIG BIG refactor. That seems more clean more clear more mockable :). I need to test all usecases of module with that refactor.
I think we can optimise subscriber more !! BUT with this refactor it's a good start saddly i don't have more time ATM to continue....
Comment #3
woprrr commentedSome fixes in this patch ;)
Comment #4
psiegel commentedHello,
I applied this patch (route_alteration_refactor-2834768-3.patch) to the dev version from Dec 09, the patch applied correctly but there seems to be an issue somewhere. I get this error when trying to view a node (even for uid 1), or when saving a node, or even when listing the nodes on the home page (promote to front). I tried to fully uninstall/ reinstall, no luck. When I uninstall the module, it works again.
Uncaught PHP Exception Symfony\\Component\\Routing\\Exception\\MissingMandatoryParametersException: "Some mandatory parameters are missing ("entity_bundle_id", "form_display") to generate a URL for route "entity.node.a_new_form_mode"." at /data/www/d8/DEV/multi01/core/lib/Drupal/Core/Routing/UrlGenerator.php line 171, referer: http://modv1.opwebs.comdev/
Best,
Pascal
Comment #5
woprrr commentedHi @psiegel,
Glad to see you and your precious feedbacks in this BIG important issue.
I think we need to drush cr after apply patch to prevent that.
I re-roll patch to prevent few other problems in user / block_content entities.
I ve reviewed operation path but we need to view more synergies with taxonomy / contact form / comment That is special cases and we need to discuss if we solve that here or on other issue. That create few more complexity to solve compatibility with ALL compatible entities.
Comment #6
psiegel commentedHello,
Thanks, this time its OK and I don't get the error anymore, the patch applied correctly.
I did the same test as in this comment: https://www.drupal.org/node/2833894#comment-11830186. I am not sure what is supposed to have changed but here is my feedback. BTW, I am only testing on content types for now since I am focusing exclusively on D8 and content. Users and other drupal are for a bit later.
1) is OK.
2) Is the same, this is for a later release I suppose
3) same issue
4) same issue
5) for later, I suppose
6) just the note.
7) same issue
Thanks again.
Best,
Pascal
Comment #7
woprrr commentedYes, fixed now.
Yes ! this feature request is verry needed now in Form Mode Manager. You can complete this issue and talk about that in #2838051: Split the default permission for entities by entity type
Yes !! That feature are possible only if previous feature developped in #2838051: Split the default permission for entities by entity type are implement. Infact if we have right to use the following bundles you can view an real listing if we have only 1 bundle available we are redirect directly in good edit_form @see \Drupal\form_mode_manager\Controller\FormModeManagerController::addPage
I create one issue to prevent possible misstakes #2838056: Filter list add page
The previous point can drastically filtered all "flood" tabs / action button. But i this we need to found an solution to provide an sort of action group that already aborded in https://www.drupal.org/node/2752467#comment-11834755 but i create an new issue dedicated for that go ==> #2838068: Local action flood limitation and #2752449: Move the "Edit as XXX" local tasks one level under the edit tab
Yes !!! That issue are important for futher version and to have an really stable version ! That already aborded by Dunebl on #2752469: Add a weight to the form modes do not hesitate to go help in that issue.
That is an normal feature and that show the power of Form mode and potential warning ! Architecturally the entity form are totaly differents forms and form A not have form B fields we can't verify if that field are not empty. It's verry important to adapt usage of form modes with your needed.
Fixed during merge of this issue.
For #2834195: Authoring Information and Promotions Options require Administer content permission i come with u for view that after having an stable release for this module i promise !!!
I think have respond all your questions best.
Really thank to your help / feedback on this issue !
Comment #9
woprrr commentedComment #11
woprrr commentedComment #12
woprrr commentedJust an information for follower of this issue #2838003: [META] - Form Mode Manager compatibility are created to point avances of module on each "standard" entities for more easy follow...
And Few feedback on issue queue are added i hope see you on that issues.
Comment #13
pianomansam commented