Notice: Trying to get property of non-object in node_page_title_pattern_alter() (line 39 of /hsphere/local/home/magco/modelmag.co/sites/all/modules/page_title/modules/node.page_title.inc).

Core: 7.0-beta2
PHP: 5.2.14

CommentFileSizeAuthor
#1 961778-pagetitle-node-check-D7.patch1.54 KBdave reid

Comments

dave reid’s picture

Version: 7.x-2.4-beta1 » 7.x-2.x-dev
Status: Active » Needs review
StatusFileSize
new1.54 KB

Simple patch that needs to check if $node = menu_get_object() actually returns anything.

nicholasthompson’s picture

Interesting.

How would you ever be on a "node/[0-9]+" page and have menu_get_item() return a non-object?

Checking if it does return an object is a fix - but it could potentially hide something else.

dave reid’s picture

If you go to node/00, that doesn't exist. Or a node you don't have access to view.

nicholasthompson’s picture

Ohhhhh good point!

das-peter’s picture

Status: Needs review » Reviewed & tested by the community

Had the same problem - Dave's patch fixed it nicely.
Thanks.

finex’s picture

I confirm it, the patch works well

duntuk’s picture

Yeah, patched worked.

Blooniverse’s picture

Thanks for the current 'Page Title 7.x-2.x-dev (2011-Jan-18)'! This works for me.

Shame only that the frontpage page titling doesn't work in my case - it is a VIEW with the path 'frontpage' and it is set correctly on '/admin/config/system/site-information'. Any good advice?

nicholasthompson’s picture

Status: Reviewed & tested by the community » Closed (fixed)

The node patch was Committed and I'm working on views at the moment.

groovyart’s picture

Is there any way to fix it without patches? Because I have the same problem (it appears when I am using webform) and I feel uncomfortable with patches (mostly because I lack the knowledge to know anything about that kind of this... I go as far as CSS, but, that's it).

rocketraman’s picture

Version: 7.x-2.x-dev » 7.x-2.5

I still see a similar issue with the latest version 7.x-2.5 when using the Webforms plugin. The patch provided by Dave Reid no longer works though.