wordpress-seo icon indicating copy to clipboard operation
wordpress-seo copied to clipboard

Conflict with the plugin "WP Permastructure"

Open cristopherrosenberg opened this issue 9 years ago • 3 comments

Please give us a description of what happened.

The XML sitemap for posts ("post-sitemap") shows the following error:

TypeError thrown

Argument 2 passed to wp_permastructure::parse_permalinks() must be an instance of WP_Post, 
instance of stdClass given

It looks like this is a conflict with the WP Permastructure plugin.

Please describe what you expected to happen and why.

I expected the XML sitemap for posts.

How can we reproduce this behavior?

Click here: https://dev.crg.world/de/post-sitemap.xml

In case I can solve this issue myself I would be happy to get any advice.

Technical info

  • WordPress version: 4.8.1
  • Yoast SEO version: 5.3.2
  • WP Permastructure version: 1.4.2

cristopherrosenberg avatar Aug 24 '17 15:08 cristopherrosenberg

Hi @cristopherrosenberg

I'm guessing that's trouble because Yoast SEO uses optimized query for fetching posts. You can try to replace this line in wp-permastructure.php:

public function parse_permalinks( $post_link, WP_Post $post, $leavename, $sample = false ) { with public function parse_permalinks( $post_link, $post, $leavename, $sample = false ) {

After this change, you need to purge sitemap cache. (try to disable/enable xml sitemaps).

stodorovic avatar Aug 24 '17 20:08 stodorovic

Hi Saša,

it worked!! :-) Thank you very much for your great support!

Thanks again,

Christopher

cristopherrosenberg avatar Aug 25 '17 01:08 cristopherrosenberg

We are happy to see that this issue has been resolved already :)

Closing the issue

PatrickYoast avatar Sep 22 '17 11:09 PatrickYoast