Support has been upgraded!
The Support Forum is closed. Not to worry! Providing the top quality support you expect and we're known for will continue! We're not ending support, just changing where you submit requests. This will provide you with the best experience possible.
Premium Support
Have you purchased an addon for Connections such as one of our premium templates or extensions with a valid license and you need help?
Please open a Support Ticket in your user account.
Free Support
Are you using the free Connections plugin? Don't worry, you are still very important to us! We are still providing you with the same high quality support that we're known for.
Please open a new support topic in the WordPress support forums for Connections.
Tagged: 8.5.1, error, php, plugin conflict, theme conflict
- This topic has 24 replies, 2 voices, and was last updated 10 years, 9 months ago by
Steven Zahm.
-
AuthorPosts
-
10/22/2015 at 7:46 pm #351482
SnailsFromJupiter
GuestThe problem with the code:
if ( ! is_object( $post ) || $wp_query->post->ID != $id || ! self::$filterPermalink ) return $title;is that you check for $post NOT being an object THEN you access $wp_query->post->ID.
However if $post is an object but $wp_query->post is not set then $wp_query->post->ID will fail, because your $post check is no protection against the illegal access.
This is safer and more sensible:
if ( ! set( $wp_query->post->ID ) || $wp_query->post->ID != $id || ! self::$filterPermalink ) return $title;The problem only ever seems to occur for a 404 anyway, so the is_404() check like we said is another double check.
10/23/2015 at 10:21 am #351526Steven Zahm
Keymaster@ SnailsFromJupiter
Looking at this post, the update one for the var_dump of $post.
Is that correct and not a copy/paste error? The 404 and known page results are the same… the var_dump for the 404 should be NULL, just like the var_dump for $wp_query->post. They should be the same. I’ve confirmed this on a couple sites, different hosts.
If these var_dumps are correct, that explains why you get the error.
Did you try adding the change that will be included in today’s update? It is fairly close to what you suggested in your last reply.
10/23/2015 at 6:27 pm #351565SnailsFromJupiter
GuestThe final response on my StackOverflow question relating to this issue was:
Unfortunately, I’m still not sure what that check is actually there
for.$postshould be an object during the_title filter, no matter if a
post is returned or a 404 is shown (sois_object( $post )seems
redundant)…$wp_queryshould be NULL if you’re on a 404 page, since
there’s no actual query object. Otherwise, I have no idea when
$wp_query->post->IDwouldn’t be equal to the$idpassed to the filter.
Honestly, I’d remove that check in favor of usingif (
!get_queried_object() ) return $title;10/23/2015 at 6:53 pm #351567SnailsFromJupiter
GuestHi again Steven
Thanks again for all your support on this issue. I can see Connections is a well nurtured plugin due to it’s dedicated developers, like yourself.
Loving the update!
Take care
Mike10/26/2015 at 11:08 am #351771Steven Zahm
Keymaster@ SnailsFromJupiter
re: Honestly, I’d remove that check in favor of using if ( !get_queried_object() ) return $title;
That would not work because that would change all titles of posts and pages throughout the site… in the nav, sidebar and such. In order to not break the SEO of the site, then title can only be changed under very specific condition. This one check is actually on one of them.
I will do some test using
get_queried_object()and adding ais_404conditional check.As it stands now though, the update did at least fix the issue for you, correct?
re: Thanks again for all your support on this issue. I can see Connections is a well nurtured plugin due to it’s dedicated developers, like yourself.
Thanks!
If you have a moment, I would truly appreciate a review as they really do make a difference. Many thanks in advance!
https://wordpress.org/support/view/plugin-reviews/connections
-
AuthorPosts
You cannot reply to this support topic. Please open your own support topic.
