Problem/Motivation
While developing the 7.x file_checker module (currently sandbox) i noticed the page title is not working for some pages. Install the media / file entity modules you will get a new menu item / page named 'Thumbnails', but when visiting this page the title will still read 'Content'.
It looks like the main top level menu item is set as the page title, and not the correct local task title from the menu.
Previous patch was an attempt to fix this in contrib, but after some talks / irc and searching, we are now convinced this needs to be fixed in core. Implementing the original fix in media, file_entity, file_checker, and so on, would not be the correct way to deal with this + if we would have, we have yet another piece of code to keep an eye on, because we would later have to remove it anyway. (and that's something we really try to prevent).
Currently core handles this for a couple of edge cases, breaking a bunch of local tasks. Patch attached to #5 is a first attempt.
More discussion: #1888782: Fix admin page title
Proposed resolution
- Fix menu_get_active_title() to use the correct local task title
I am not sure at this point if we first need to fix this upstream (D8), or that this will be a D7-bugfix-only, that's open for debate.
Remaining tasks
- TBD
User interface changes
- The page title will display correctly once fixed for local tasks.
API changes
- TBD
Original report by Rob C
This patch makes the page title show up as 'Files' for the file admin page. It now renders as 'Content', and that's not correct. Just a very minor thing.
Similar patch for Media:
#1888782: Fix admin page title
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | 1888780-page-title-is-wrong-for-some-local-tasks-5-test-only.patch | 2.72 KB | Rob C |
| #5 | 1888780-page-title-is-wrong-for-some-local-tasks-5-inc-tests.patch | 3.33 KB | Rob C |
| file_entity_admin_page_title_fix.patch | 471 bytes | Rob C |
Comments
Comment #1
dave reidThe 'Comments', 'Book' and other tabs under admin/content have the same problem. Maybe this is a bug that should be fixed in core, or considered works as designed?
Comment #2
slashrsm commentedI would agree with Dave. If this is a common problem for all pages under Content, it should probably be fixed in core.
Comment #3
ParisLiakos commentedComment #3.0
ParisLiakos commentedAdded related link.
Comment #4
ParisLiakos commentedyeah, should go in d8 first..same bug there as well
Comment #5
Rob C commentedJust a test.
I'm not sure if this is the correct way. Yes, it could be done simpler, but with all the changes to the menu system over the last 2 years... I can not find why we change the basic way we deal with local task titles for what i see are just a couple edge cases that indeed work, but effectively end the correct operation for Loads of other local tasks, but i do see the reason.
So yes, this does need more work, and maybe we can check for a 'map' first, that's what i'm searching for now. More info is very welcome!
Comment #5.0
Rob C commentedUpdated to new status.
Comment #6.0
(not verified) commentedUpdate issue - patch link.
Comment #15
quietone commentedI tested this on Drupal 8.9.x, 9.3. and the page titles were correct and match what I understand from the IS. The problem is still found in Drupal 7-8.dev. Therefore, moving to the Drupal 7 issue queue.