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.
We aren't supposed to use the word "node" in the user interface for Drupal 7. See http://drupal.org/node/604342
On the triggers admin page, the word "Node" is used as the tab title for the node-related triggers. (admin/structure/trigger/node -- see screen shot attached).
Probably the only way to fix this is rather ad-hoc but it should still be fixed...
Comment | File | Size | Author |
---|---|---|---|
#28 | 678606-trigger-menu-d7.patch | 9.27 KB | andypost |
#23 | trigger-comments-d7.PNG | 21.24 KB | andypost |
#23 | trigger-node-d7.PNG | 21.18 KB | andypost |
#23 | trigger-system-d7.PNG | 23.24 KB | andypost |
#19 | 678606-trigger-menu-d7.patch | 9.42 KB | andypost |
Comments
Comment #1
jhodgdonforgot tag
Comment #2
Bojhan CreditAttribution: Bojhan commentedI am not sure if this is truly a bug, our goal is indeed to avoid useage of Node - however it is a goal, whenever the context says us to do different we most definitely should. The trigger UI in that sense, to me applies to a different context - which is of building relationship models of objects (Content item ID) would be one to go for, however it is technically incorrect to call this tab Content (as it would house the object, comment to).
Comment #3
jhodgdonWell, I think this is truly the only place in the entire UI that the word "Node" appears, aside from the term "Node module", which is the name of node.module...
Comment #4
jhodgdonAlso, just as a note, the help text for the page says something about actions related to "content". Should that also be changed to say "node"?
And if we are going to have the word "node" appear so prominently as a tab, I think we need to define it in the node.module help file.
Comment #5
Bojhan CreditAttribution: Bojhan commentedHmm, this is hard. I am not sure, hope someone else will chime in.
Comment #6
jhodgdonOK, I have a solution. The tabs on the Triggers page are module names, and the Node module is still the name of that module, for better or for worse.
So I changed around the help to say that there's a tab for each module and to link to the module's main help screen. This involved a slight refactor of the code in trigger_menu() that generates the tabs, to avoid writing the same code twice.
Here's a patch and a screen shot.
Comment #8
jhodgdonHere's a patch with a slight change so it now passes the tests, at least on my install.
Comment #9
Bojhan CreditAttribution: Bojhan commentedLooks good, RTBC
Comment #10
cosmicdreams CreditAttribution: cosmicdreams commented#8: 678606fix.patch queued for re-testing.
Comment #12
cosmicdreams CreditAttribution: cosmicdreams commentedhere's the .rej I get when I try to apply this patch:
Comment #13
andypostMarked as duplicate #659838: trigger help for system group is not generic.
Also menu related #544318: Rework trigger_menu()
Comment #14
jhodgdonHere is a straight reroll of the patch above. It was RTBC before.
Comment #15
andypostWhy not use system_list() against querying database?
Comment #16
jhodgdonProbably a good idea. Care to make a new patch?
Comment #17
andypostRe-roll, fixed indent in hook_help()
_trigger_tab_information() now uses API to get triggers and modules info
Comment #18
andypostFixed indent for doc-block
Comment #19
andypostI think better to query only modules that have triggers because this lead to less memory consumption
Comment #20
jhodgdonSo, you've basically gone back to my patch in #14 after all? I am having trouble seeing the differences...
Comment #21
andypostMain difference that my patch uses only 1 query and a bit indent fixes.
Comment #22
jhodgdonOK. I'll need to test it out and make sure it actually works (i.e. look at the help screens). The code looks fine though.
If you want to save some time and post screen shots of the Trigger module main help page, and the admin/structure/trigger/* pages (probably one is enough, like in #6 above), that could speed this patch along. Just want to make sure it still does the same thing.
Comment #23
andypostScreens are looks the same except a link at the bottom of help text
Comment #24
andypostThis also a performance improvement because 5 queries are going to be 1 in hook_menu()
Also we need seting for MENU_DEFAULT_LOCAL_TASK as proposed in #544318-12: Rework trigger_menu()
Comment #25
jhodgdonI don't think it's a performance improvement over what was in core previously -- it's just a performance improvement against my other patch. And since this is in the trigger component, it shouldn't need a trigger tag.
Thanks for the screen shots, showing that the patch works. I agree it's improved over my version above, and it works the same. Since the text was already approved, let's get this in before HEAD changes again...
Comment #26
andypostCurrent implementation make a query per each module that defines hook_trigger_info()
You could see foreach() loop with db_select() inside http://api.drupal.org/api/function/trigger_menu/7
Comment #27
Damien Tournoud CreditAttribution: Damien Tournoud commentedWe cannot do that.
1. It's really not a performance improvement, as hook_menu() is only called when regenerating the menu
2. Just call system_get_info() here, instead of trying to write a SQL query by yourself
Comment #28
andypostRe-roll with system_get_info()
Comment #29
andypost#28: 678606-trigger-menu-d7.patch queued for re-testing.
Comment #30
jhodgdontagging
Comment #31
jhodgdonI think all of the concerns about this have been addressed.
Comment #32
webchickWell, that's certainly... interesting... code there to work around this bug. :) Oh, Trigger module...
I spoke with Jennifer about this in IRC. Unlike #690622: Word "node" is still being used all over Drupal 7... where the word "node" is clearly appearing in human-facing sentences where it ought not to be, this one is a bit more borderline:
We actually do want the module name there, which is Node. "Content" module is a different thing. Unlike those other strings, this is a site-builder/developer-hybrid facing page.
But even aside from those general misgivings, the patch includes this hunk:
...with no corresponding + hunks. I'm sure it's not intentional to remove this hook (if it was, we should remove the trigger.api.php reference, too), so this doesn't quite pass my RTBC smell test.
So rather than trying to rush this in when it's already somewhat borderline, I'm going to kick this to D8. Jennifer seemed cool with it in IRC too, stating that people should just be using Rules anyway. :D
Comment #33
jhodgdonActually, I jsut realized the drupal_alter call is now in
http://api.drupal.org/api/drupal/modules--trigger--trigger.module/functi...
which is what is replacing that hunk (centralization++)
So maybe we could get this in... but I'm not ready to fight for it, so I guess not.
EDIT- added:
To clarify, the hunk with the alter call is being replaced by a call to a new function _trigger_tab_information() , which calls _trigger_get_all_info(), which does the drupal_alter.
No alters were killed in the above patch.
Comment #34
jhodgdonAnd just to clarify, changing the title.
What this patch actually does/did is:
a) Use the human-readable name of each module as the tab name
b) Standardize the help text so it clarifies what the tabs are and links to each module's help page.
c) Cleans up the code in the hook_menu() implementation, using system calls instead of queries.
Maybe we should move it back to D7 after all?
(webchick: don't shoot me, please! You can override and move back to D8 if you want, and I won't complain. Sorry I was pressed for time in IRC earlier and didn't have time to figure this out then...)
Comment #35
andypost+1 for d7, there's no api changes and introduced strings cleanup just make a translators job a bit easy
Comment #36
webchickOh, ok. Upon actually testing it, I can see that it doesn't change the "Node" title at all, and it is indeed just internal re-organization of some stuff and getting rid of a bunch of almost-duplicate strings.
I still think this looks a little funny, but on the other hand it's "just" Trigger module, so is unlikely to seriously hurt anyone.
Committed to HEAD. Thanks!