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.
When I opened the /admin/appearance I got this message:
Notice: Trying to get property of non-object in shortcut_preprocess_page() (line 542 of /modules/shortcut/shortcut.module).
Comment | File | Size | Author |
---|---|---|---|
#11 | shortcut-722650-11.patch | 4.98 KB | tim.plunkett |
#9 | 8-9-interdiff.txt | 864 bytes | alexpott |
#9 | 722650.9.shortcut-no-links.patch | 1.62 KB | alexpott |
#8 | 722650.8.shortcut-no-links.testonly.patch | 848 bytes | alexpott |
#8 | 722650.8.shortcut-no-links.patch | 1.47 KB | alexpott |
Comments
Comment #1
Tresler CreditAttribution: Tresler commentedCan you provide any more detail on this? Are you at HEAD? Does this happen consistently? Are you logged in as user 1 or other?
I looked over the code in that function and can't see where it would be throwing that error. Which is not to say it isn't possible, but that I can't recreate the error.
Thanks.
Comment #2
arpeggio CreditAttribution: arpeggio commentedI downloaded the 7.x-dev and installed as minimal profile and installed some modules which I already forgot (sorry). From what I remember not only in /admin/appearance but in all the pages I went I got that error message. I was logged in as user 1. Then I emptied my database and installed the alpha-2 version as standard profile, that error message was gone.
Comment #3
David_Rothstein CreditAttribution: David_Rothstein commentedWere you definitely using a recent version of 7.x-dev when you experienced this? A while ago, there was a bug in the overlay module that caused this issue when the overlay and shortcut module were turned on at the same time. However, that was fixed a while ago - see #658118: Overlay prevents other modules turned on at the same time from being enabled correctly
See if you can still reproduce this with the latest codebase and if so, list the exact steps you took to trigger it (which modules you turned on, etc). Thanks!
Comment #4
arpeggio CreditAttribution: arpeggio commentedI updated my drupal in CVS and tried to reproduce the setup, it seems fine now. Thanks.
Comment #7
goldcrusaider CreditAttribution: goldcrusaider commentedHi Can I reopen this? I have the same problem as the user above.Im running windows xp and Drupal 7.1.x installed a packaged drupal install with a theme template. Im getting the error: "Trying to get property of non-object in shortcut_preprocess_page() "
This happened after a new install. I don't have any php background can someone help?
Comment #8
alexpottThis still occurs in drupal 8.x
To reproduce:
You will see the following error once the module is installed...
Unfortunately just adding a default links property to the Shortcut ConfigEntity fixes the issue but causes test failures.
Comment #9
alexpottThe fix in #8 was not quite right...
Comment #10
tim.plunkettThere's actually a deeper bug here, I'll post something in a bit.
Comment #11
tim.plunkettComment #12
alexpottTim's patch fixes the shortcut entity to always only have valid menu links by implementing hook_menu_link_delete() in the shortcut module. The patch also tidies up the shortcut entity so that the links property is always an array which results in some nice removals of
if (isset($entity->links)) {
... good work!These changes look good to go to me.
Comment #13
tim.plunkettComment #14
Dries CreditAttribution: Dries commentedSomehow I thought we had deleted the shortcut module. :p
Comment #15
webchickNot yet, unfortunately. :) Can't until/unless Menu module provides the option to do per-user derivatives.
Committed and pushed to 8.x. Thanks!