Yoast / duplicate-post

Yoast Duplicate Post plugin for WordPress
https://yoast.com
GNU General Public License v2.0
46 stars 35 forks source link

NULL value of duplicate_post_taxonomies_blacklist is not processed correctly #263

Closed aleks-lynx closed 7 months ago

aleks-lynx commented 2 years ago

Hi,

I found that "duplicate_post_taxonomies_blacklist" can be NULL sometimes, but the code expects an empty string only.

// duplicate-post/admin-functions.php:287
if ( $taxonomies_blacklist === '' ) {
    $taxonomies_blacklist = [];
}

NULL should be checked here as well, by using empty() for example.

Original post in the support forum: https://wordpress.org/support/topic/taxonomies-are-not-copied-because-duplicate_post_taxonomies_blacklist-is-null/

We're using version 4.5 of the plugin at the moment.

michael-sumner commented 9 months ago

Hey @aleks-lynx

Letting you know that I have also encountered the issue. I have created a fix for this:

https://github.com/Yoast/duplicate-post/pull/360

Were you still facing the issue, or did you manage to find an alternative — out of curiosity?

aleks-lynx commented 9 months ago

Hey, as a temporary solution, I fixed that locally via actions dp_duplicate_page and dp_duplicate_post, so my code copies the taxonomies always correctly but after the plugin.