Support » Plugin: Permalinks Customizer » Posts end up with the same slug when editing in bulk mode

  • Hi Aliya,
    Hi Sami,

    I ran into a problem with your plugin. It seems, you are using global variables in your functions, this leads to the problem, that all posts end up with the same slug, when one’s editing them in bulk mode or within a query programmatically.

    It tooks the slug of the first page inside this query and then adds it to all further posts, so all previous slugs got replaced by the same one.

    Can you replicate my issue? Is there any way to handle it different, without these variables?

    When you’re saving data in $_REQUEST (global), it won’t get resetted on the next post edit. We’ve solved that with a workaround so far:

    foreach($_REQUEST as $key => $val) {
    if(preg_match("/^permalinks_customizer/", $key)) {
    unset($_REQUEST[$key]);
    }
    }

    Maybe this helps you, to understand the problem better. It would be great, to solve this issue inside the plugin itself, because it also happens when one’s for example switching the post type of some posts with the post type switcher plugin, which is very common.

Viewing 6 replies - 1 through 6 (of 6 total)
  • No support anymore, because there are a few threads unanswered. Or are you on vacation right now? 🙂

    The problems seems to be located here:

    permalinks-customizer/frontend/class-permalinks-customizer-form.php, line 530:

    if ( ! isset( $_REQUEST['permalinks_customizer'] ) ) {
      $_REQUEST['permalinks_customizer'] = $url;
    }

    I’ve commented out this part, now switching post types and bulk import posts is working without getting the same slug on each post. But probably only a temporary fix, not sure what will be affected else. But until now I didn’t find a new problem, setting permalinks works as usual.

    Plugin Author Sami Ahmed Siddiqui

    (@sasiddiqui)

    Hi @mattce

    Sorry for the delay in my response. What do you mean by the bulk mode? Are you using any plugin for it? If yes, then which one?

    I would love to make it fixed with you and other users if I may able to replicate the issue on my end.

    Thanks,
    Sami

    Hi Sami, great, that you are back 🙂

    The problem occurs e.g. when using the post type switcher (https://de.wordpress.org/plugins/post-type-switcher/) plugin or when creating multiple posts with wp_insert_post().

    For replicating the issue:
    Install the post type switcher plugin and then:

    1) Create some normal posts and set some custom slugs for them
    2) Go to the general /wp-admin/edit.php page
    3) Click on the select all checkbox left to the “Title” label
    4) Open the “Bulk Actions” dropdown and select Edit -> Apply
    5) Select the new post type in the “Post Type Dropwn”
    6) click Update

    The posts are now getting migrated into the new custom post type, but from now on all of them are sharing the same post slug.

    If you can’t replicated the issue, I will record a video for demonstration purpose, just let me know.

    Greetings

    Hi Sami, any news here? Have you been able to replicate the issue? 🙂

    I have this same issue too, I lost couple of pages on google because of it, please kindly fix this.

Viewing 6 replies - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.