Support » Plugin: WP Category Permalink » Problem with the update saving data as serialized value

  • Resolved Shinji3rd

    (@shinji3rd)


    Hi!

    I am using this plugin since almost its launch date. Now I am a Pro user too. It is really useful for me not only for SEO, but also because my website has a theme that use different colors according the selected permalink.

    With versions up to 2.x it all worked good, except for some compatibility issues after a new update of Yoast SEO. Version 3.x solved that compatibility problem, but brought a new problem that had me hours investigating the cause until I have found it: old version saved the category_permalink table in the DB as an integer, and new version saves a serialized value. As my theme uses that value for assigning the proper category name and color, all the entres I post after the update shows the default color and “no category” as the post category.

    I have managed to modify the settings of my widgetized homepage to unserialize that value after getting it (if serialized, so it does not break old posts), and select the proper numeric value from the created array. With this, now it shows the correct categories and category color according to what I have selected as permalink using the plugin.

    BUT, when you open a post, it still shows as “no category” and uses the default color of my theme. I have touched everywhere and I can’t find where to modify this so it can work again.

    Let me post some examples so you can see exactly what I am taking about:

    -Here’s the webpage: http://www.combogamer.com
    You can see entried blocks with different colors according to the category, and that category is determined by the category permalink I have chosen using this plugin.

    -Here’s an entry that is shown with the category “PlayStation” at the webpage, and its corresponding blue color, showing as No Category when you read the post, and showing the default green color: http://www.combogamer.com/22281/nuevas-y-espectaculares-imagenes-de-the-last-guardian/

    -Here’s an older entry, from where the plugin saved the permalink field in the database as an integer, also from the PlayStation catgory, and you can see it showscorrectly, blue backgrounds and correct category shown: http://www.combogamer.com/21617/equipo-kim-demuestra-valia-the-king-of-fighters-xiv/

    Is there a way to change this globally, maybe in the functions.php of my theme or something, so it can replace the category_permalink value if it is serialized with the corresponding integer value for the selected category?

    Thanks in advance.

    https://wordpress.org/plugins/wp-category-permalink/

Viewing 1 replies (of 1 total)
  • UPDATE: OK, I fixed it. I had to modify two different files, adding some code to verify if the value is serialized, and in case it is, unserialize it and use the integer numeric value for the category. I had to read many many things, and learn about features that were new to me, but now it is all working fine, so I am marking this as solved.

Viewing 1 replies (of 1 total)
  • The topic ‘Problem with the update saving data as serialized value’ is closed to new replies.