Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
andypost reviewed this module (in its core patch format) on #2920309-13: Add experimental module for Help Topics and suggested:
+++ b/core/modules/config_help/src/Entity/HelpTopic.php
@@ -0,0 +1,331 @@
+ * id = "help_topic",
+ * label = @Translation("Help topic"),
+ * config_prefix = "topic",
+ * handlers = {
Probably it could use route_provider to generate routes
Comment | File | Size | Author |
---|---|---|---|
#6 | 2920839-6.patch | 3.07 KB | andypost |
Comments
Comment #2
jhodgdonOn #2920843: See if we can use EntityDeleteForm instead of HelpDeleteForm I concluded that we could probably use the default entity delete confirm form for help topics if we defined a collection link and a collection route.
I had patched the HelpTopic entity class in the heading to look like:
but that collection route didn't work and I got errors like this:
That's because admin/config/development/help is currently defined in config_help.routing.yml as
not as a collection entity route.
So it seems sensible to add the task of defining the collection entity route to this issue, then go back and see about the delete confirm form.
Comment #3
jhodgdonThis turned out to be fairly straightforward. Here's a patch. Tests pass locally.
Note: To apply the patch if the module is in core/modules, the info.yml line has to be applied manually, because the info file is slightly different there. Everything else should apply fine.
Actually... this is pretty straightforward and boilerplate. The only difficulty is that it changes one route name from a custom route (config_help.topic_admin) to a standarized one (entity.help_topic.collection). But this is a sandbox module so I think no other contrib modules will be depending on that route name staying the same...
I think I'll go ahead and commit it to the sandbox, and update the patch on the core issue.
Comment #4
amateescu CreditAttribution: amateescu for Pfizer, Inc. commentedThe
Drupal\<module_name>\Entity
namespace is meant only for actual entity classes, so I would suggest to put the route provider one level above (i.e. directly in thesrc/
folder).Comment #5
jhodgdonSure, can do that.
Comment #6
andypostMoved class + fixed coding standards in changed files
Comment #7
jhodgdonPerfect, thanks! Yeah, my stupid editor always wants to indent twice in situations where you have nested parens, though Drupal standards only indent once. Serves me right for being stuck on Emacs since the dark ages. :)
Committed this to the Sandbox and updating the Core patch as well.