Help Desk

Filter bar not showing results for bulk edited events

  • Posts: 20 Topics: 10
    | Permalink

    Hi there,

    Hope you can help. I used a plugin to bulk edit a custom field. The filter bar does not show results for the events that were bulk edited.

    On the single event page the edited events show the correctly edited field, and in the back end editor the edited events show a tick box against the edited field.

    I’ll reply with a PDF with some screenshots so that you can see what I mean. Happy to give you credential for my staging site if you want to poke around.

    Regards,
    Chris.

    Posts: 20 Topics: 10
    | Permalink
    This reply has been marked as private.
    Posts: 2161
    | Permalink

    Hi Chris!

    We are limited in the amount of support we can provide for issues caused by third party plugins, but I will try to help.

    What is the name of the plugin you are using to edit the field? Which field are you editing? If you manually make the edit without the plugin, does the filterbar behave as expected?

    Thanks,
    Sky

    Posts: 20 Topics: 10
    | Permalink

    Hi Sky,

    The plugin is “Bulk Postmeta Editor”. I think I remember running in to a similar issue with CSV import, whereby the field would be updated but wouldn’t show up in the filter bar results.

    I’m editing _ecp_custom_4 “Series”

    If you have any other suggestions for bulk / editing this field I’d love to hear them.

    Posts: 2161
    | Permalink

    Chris,

    What’s interesting is that the correct tags are showing in the event details. What happens if you go to one of the events that was bulk edited, add a space or something to trigger a change, and save? Does it then show when selecting the tag from the filterbar?

    Thanks,
    Sky

    Posts: 20 Topics: 10
    | Permalink

    Hi Sky,

    I somehow missed / did’t get notification of your reply so my apologies for not getting back to you. To answer your question: If we go to the event editor for one of the bulk edited events and click ‘update’ the event will then show in the filter bar results correctly. There’s no need to add any spaces or make any further changes.

    In the mean time I have tried some more troubleshooting. I reverted to default WordPress TwentySeventeen theme and disabled all plugins except Event Calendar, Event Calendar Pro and Event Calendar Filter Bar. The I used the CSV import to update _Event_Category and _ecp_custom_4.

    Import of _Event_Category works perfectly. Import of _ecp_custom_4 exhibits the same behaviour as described previously. Ie. the field updates but does not show in filter bar results. If we go in to the event editor and click update then it will show in the filter bar results.

    Hope you can help with this as I really, really don’t want to be manually updating this field for hundreds of events.

    Regards,
    Chris.

    Posts: 2161
    | Permalink

    Chris,

    It appears that maybe something more is happening when you save an event with a custom field, probably attached to the “save” hook. The plugin you are using is updating the field, but not triggering whatever that functionality is until the event is saved.

    Unfortunately, there’s not much I can do to help with this. Third party plugins are beyond our realm of support, and bulk editing is not something built into our plugins.

    If you have any other questions or issues, please let us know.

    Thanks,
    Sky

    Posts: 20 Topics: 10
    | Permalink

    Hi Sky,

    I have the exact same issue when I update the custom field when using the Events Calendar CSV import. So please could you help me with that?

    When I tested the CSV import I reverted to WordPress TWentySeventeen and disabled all other plugins.

    Regards,
    Chris.

    Posts: 2161
    | Permalink

    Chris,

    I apologize, I didn’t realize you were having the issue with the Events Calendar import as well. I will try to help with that.

    Can you provide the CSV file that you are importing?

    Thanks,
    Sky

    Posts: 20 Topics: 10
    | Permalink
    This reply has been marked as private.
    Posts: 2161
    | Permalink

    Chris,

    I was able to import the event and use a custom field that I had set up to sort the events in the month view of the calendar, without going to the event and saving.

    When you do the import, are you assigning all of the relevant columns to the fields in the preview section?

    Do you have an event setup on your site that I can see not showing with the filter? If so, please provide a link to the event.

    Thanks,
    Sky

    Posts: 20 Topics: 10
    | Permalink
    This reply has been marked as private.
    Posts: 2161
    | Permalink

    Chris,

    I was unable to access the site using the credentials provided. However, I re-tested this using checkboxes as the custom field type, and was able to reproduce the issue with the filterbar. It sees the pipe separated values as all one value until you visit the event and save.

    Thank you for all the detailed information you have provided. I have created a bug ticket for this. Unfortunately, I cannot provide a timeframe for when this will be fixed. You should receive a follow up here once it is addressed.

    Please let us know if you have any other questions or issues in the meantime.

    Thanks,
    Sky

    Posts: 20 Topics: 10
    | Permalink

    Hi Sky,

    I’m glad you were able to recreate and log the bug. Is there any chance you could help me with some kind of workaround until the bug gets fixed? Perhaps some way of pragmatically triggering a save / update for all events?

    Thanks,
    Chris.

    Posts: 2161
    | Permalink

    Chris,

    You could try something like that, but I’m not sure that it will work or if it will have any unintended consequences.

    If you’re willing to give it a shot, I can create a snippet that would do so, with no guarantees. I’d recommend making a backup of your site first, in case something goes awry.

    Try adding this to your functions.php and visit the site once. Don’t forget to remove once you’re done.

    add_action('init','example_event_save_all');
    function example_event_save_all(){
        $my_posts = get_posts( array('post_type' => 'tribe_events' ) );
        foreach ( $my_posts as $my_post ):
            wp_update_post( $my_post );
        endforeach;
    }
    

    Let me know if that works!

    Thanks,
    Sky

    Posts: 20 Topics: 10
    | Permalink

    Sky,

    Thanks for the code. Unfortunately it didn’t work for me. I can’t tell if it did anything at all but certainly didn’t update the event withe the filter bar issue.

    Anything else we can try?

    Cheers,
    Chris.

    Posts: 2161
    | Permalink

    Chris,

    It was worth a shot. Thanks for trying. Unfortunately, I don’t have any other workarounds to suggest.

    We will have to wait for the development team to take a look and figure out a solution. We’ll let you know when any progress has been made on the ticket.

    Thanks for your patience,

    Sky

    Posts: 20 Topics: 10
    | Permalink

    Sky,

    I did a little more digging in to this by looking at the database tables in the back end and have found source of the bug.

    For each custom field in each post there are at two meta_key in the wpff_postmeta table:

    _ecp_custom_x
    __ecp_custom_x

    For a post that has single value for the custom field the table looks like:
    meta_key – meta_value
    _ecp_custom_x – value1
    __ecp_custom_x – value1

    For a post that has multiple values for the custom field, the first meta_key contains all the values and the second meta_key is replicated and for each value table should look like this:
    meta_key – meta_value
    _ecp_custom_x – value1|value2|value3|valuen+1
    __ecp_custom_x – value1
    __ecp_custom_x – value2
    __ecp_custom_x – value3
    __ecp_custom_x – valuen+1

    However, when we use the CSV import to import a custom field with multiple values the table looks like:
    meta_key – meta_value
    _ecp_custom_x – value1|value2|value3|valuen+1
    __ecp_custom_x – value1|value2|value3|valuen+1

    After importing from CSV I can manually go through the db and add the required additional meta_keys in order to get the filter bar to display properly.

    As a workaround until the bug is fixed, would it be possible that someone there at tribe could write a piece of script to rectify the table entries? I don’t have the knowledge / experience to be able to write it myself.

    Thanks,
    Chris.

    • This reply was modified 6 months, 3 weeks ago by  iamchrisone.
    Posts: 2161
    | Permalink

    Chris,

    Looks like you found some interesting stuff while digging around! Unfortunately, we will have to wait until this is able to be looked at by someone on the development team. Occasionally, they will post a temporary fix once they’ve had a chance to process the bug ticket, if there will be a delay in getting the fix published in a release. However, we will still need to wait for this to go through the queue before it can even be looked at. I am tracking on this bug, and if a temporary fix is posted, I will certainly share it with you!

    Thanks for your understanding.
    Sky

This thread hasn’t seen any activity for quite some time and we are not accepting further replies.

If you need further help with this or any other issue, please create a new topic (you can of course include a link to this one if that helps to provide additional context) and one of the team will be only too happy to help.