Steps to reproduce:
- Install fresh Drupal site and download CTools 7.x-1.x
- Create a new "Article" node ...
- ... with the title "Page title"
- Click "Provide menu link" and set the Menu link title to "Menu title"
- Click "Save"
- Click the "Edit" tab, and notice that the page title is correctly "Edit Article Page title"
- Enable the Page Manager module
- Go to "Admin" -> "Structure" -> "Page"
- Enable the "Node add/edit form" page (but don't edit it)
- Go back to the node edit form for the node we created in step #2 (probably at
/node/1/editif you really installed fresh) - Notice that the page title is INCORRECTLY set to "Menu title"
I'm really not sure how it gets set to the menu link title, but there is nothing in Page Manager to set the default page title in case no variants are selected on the "Node add/edit form" page. The expected behavior is that if no variant is selected, that we simply fallback on the default Drupal behavior.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | interdiff.txt | 1.33 KB | dsnopek |
| #5 | ctools-menu-title-on-edit-2673298-5.patch | 1.34 KB | dsnopek |
Comments
Comment #2
dsnopekFixing type-o's.
Comment #3
dsnopekHere's a patch that works in my testing!
Comment #4
dsnopekI've found a flaw in this patch. This same callback is being used for 'add' pages as well as 'edit', but this always shows the title for 'edit'. It needs to check if there is a node already or not!
Comment #5
dsnopekHere's a new patch that takes into account the node add page as well!
Comment #6
cboyden commentedWe're using this patch and it's working well.
Comment #7
rivimeyComment #8
joelpittetComment #17
joelpittetComment #26
joelpittetComment #27
joelpittetThanks everybody for the fix and I've credited a bunch of people form #1369852: Page Manager displays menu title instead of node title too which had a similar RTBC patch. Committed to dev for next release (today)
Comment #30
jfuentes commentedThis solution unnafortunatelly breaks the developments of modules that alter the node add/edit titles using. the $form["#after_build"][], that worked fine during lot of years, and after this update dissapeared showing ugly titles to final users with the content type name.
Comment #31
mustanggb commentedAnyone have a workaround for this to let modules set titles?
Previously it was working with a
hook_form_node_form_alter(), but not anymore.EDIT:
Have managed to workaround with: