• Resolved Patrick Jackson

    (@pjackson1972)


    Hi Marcel,

    Thank you for taking over maintenance on this project; this seems like a great plugin!

    I’m looking at added this plugin to a Shopp eCommerce site so our client could easily customize the order of product categories listed.

    We first added and tested the plugin on our development instance, and it worked normally. When I installed it on our staging instance for review by the client, I found some odd behavior, and haven’t been able to track down the cause. I’m hoping you might be able to shed some light.

    This may be a similar issue to the ones described in earlier posts (1 & 2). Maybe since we have a case where the issue presents itself on one instance and not on another, we’ll be able to help resolve it.

    The behavior I’m seeing seems to be limited to taxonomies with sub-taxonomies, other taxonomies seem to behave normally. Changes to the Auto-Sort Queries are not stored when I click the Save Settings button, and changes to the custom sort order are not stored when I click Update Order.

    As I said, our development instance seems to work normally, while the staging instance displays this behavior. The staging instance is more similar to the production instance, and lives on the same server, while the development instance lives on a different server.

    I tried disabling all other plugins and switching to a default theme (Twenty Twelve), but the behavior persisted.

    If it’s okay, I’ll follow up this post with an email with credentials for an admin account I’ll set up for you as well as links to the sites.

    Thanks for your help!

    https://www.ads-software.com/plugins/custom-taxonomy-order-ne/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Marcel Pol

    (@mpol)

    Hi, I am not sure what is going on. It doesn’t just happen in the Shopp categories but in the normal categories as well.
    I have a test install with PHP 5.4, and with subcats and Shopp it all works normally.

    There might be a few things you can look at.
    It is almost as if the term_order field is not in the database tables. Could you check that they exist? And do they have values after updating the order?
    Also, is there anything in the logfiles?
    If this doesn’t give a hint of what is happening, you could add debug code.
    In customtaxorder.php the function customtaxorder_update_order() saves the term_order.
    Also, the get_terms() on line 126 of page-customtaxorder.php should get the terms with term_order as field included.

    Plugin Author Marcel Pol

    (@mpol)

    Oh about the other 2 posts you reference.

    1 was about the order that subterms should get. THe first subterm starts counting at the order of the parent. That post was about a request to change that.

    2 was specifically about ACF term fields.

    Thread Starter Patrick Jackson

    (@pjackson1972)

    Hi Marcel,

    I was able to gain some insight into the issue. Although I don’t quite have the specifics nailed down, I think it was related to memcached. My short term solution was to turn off memcached.

    First, let me answer your questions…

    It is almost as if the term_order field is not in the database tables. Could you check that they exist? And do they have values after updating the order?
    Also, is there anything in the logfiles?

    The Custom Taxonomy plugin was storing changes to the term_order field as expected in the database. The field existed, and was being updated when I clicked the Update Order button. There weren’t related errors showing in any of the logs.

    The issue was that when the page loaded, a cached version of the term objects (or maybe the query) was used. If I were being more specific in my earlier description (I wasn’t sure this was the case at the time), the terms were reordered, but it only worked the first time. Subsequent updates didn’t appear to work because the page was loading the cached objects as indicated by echoing a var_dump() of $terms. However, when I looked in the database, the term_order field on the records did show the updated values. Since the term_order fields stored in the database didn’t match the term_order fields in the query results on the page, I could only imagine that caching was the culprit.

    The instances were running on SiteGround with memcached activated on the server. As I understand it, in order to take advantage of memcached, you need to use their SuperCacher plugin. The plugin is responsible for communicating with the caching system external to the WordPress installation.

    Now, my understanding is pretty hazy, but I suspect the SuperCacher plugin may need some attention, because it looked like caching wasn’t activated in the plugin. However, whenever I purged memcached my most recent changes were reflected on page load.

    I think disabling the plugin didn’t work because I failed to purge the cache immediately before disabling the plugin. Since the caching system lives outside of WordPress, I think the objects continued to be cached, making it appear the issue was not a plugin conflict.

    I mentioned, our DEV instance did not have the issue. Although it did have caching activated at the server level, it did not have the SuperCacher plugin installed. So, I think this boils down to a conflict with the SuperCacher plugin insofar as I think if it hadn’t been installed, we wouldn’t have seen an issue.

    I noticed that the term orders were stored using prepared statements, and wondered if the caching plugin was having a problem with them for some reason. It looked like memcached wasn’t being triggered to purge on update.

    In any case, this sounds more like an issue with the caching plugin than with Custom Taxonomy Order. Turning off caching at the server level seems to have fixed the issue for now, and I’ll follow up with SiteGround and troubleshoot their plugin to further resolve the issue and hopefully get caching to work reliably.

    Thank you for your help, and thanks again for all your great work on this plugin!

    Plugin Author Marcel Pol

    (@mpol)

    Okay, that is interesting. Thanks for coming back on it.
    I have no experience with memcached.
    If you’d need to have this plugin talk to memcached to purge the object db, I could look into that. But if you use the SuperCacher plugin for that, it might be good to look into that one first.
    Have a good weekend.

    Anonymous User

    (@anonymized-7837873)

    Vary late to the party, but if you are looking for a fix, this will probably do it… https://www.ads-software.com/support/topic/a-fix-for-displayed-order-if-you-have-object-caching

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Changes to taxonomies with sub-taxonomies not stored on clicking Save/Update’ is closed to new replies.