Support

Search results for ""

Sorry, no results found. Perhaps you would like to search the documentation?
All Topics
AMPERAGE Marketing & Fundraising

Proposed Fix: Incorrect Events Calendar organizer shown in column & inline edit

I have a site using The Events Calendar Pro, and some of my events are setting their organizer ID as “0” when saved rather than leaving this value empty. Meanwhile, the current behavior of the Organizer column and inline-editor for The Events Calendar add-on has it check if the IDs are empty, but it doesn’t actually check if these IDs happen to be 0 (which shouldn’t otherwise match anything). This then had the 0 ID being parsed using the previous event’s details for the eventual unexpected result.

My fix is quick & easy.

First, edit /ac-addon-events-calendar/classes/Column/Event/Organizer.php (column output) so that:
if ( ! $post_ids ) {
is instead:
if ( ! $post_ids || $post_ids[0] == 0 ) {

Then, edit /ac-addon-events-calendar/classes/Editing/Event/Organizer.php (inline editor output) so that:
if ( ! $ids ) {
is instead:
if ( ! $ids || $ids[0] == 0 ) {

This fixes the issue entirely! I’d love to see this fix officially implemented as this is a standard site using The Events Calendar as expected with this one bug happening when it could be easily avoided moving forward.

Thanks for the great plugin!

5 years, 6 months ago
Stefan van den Dungen Gronovius
Developer

Hi Kurt,

Thanks for your feedback and proposal.
I did have a look and you’ll get indeed unsuspected results when the post_id is 0.
Instead of building in the checks you proposed, it can easily be fixed by changing the get_raw_value() method in /ac-addon-events-calendar/classes/Column/Event/Organizer.php

If you run the value through array_filter() it removed any results with 0 and the data is also corrected for Editing.
This issue will be fixed and released immediately.

Thanks again for your input!

5 years, 6 months ago
AMPERAGE Marketing & Fundraising

Got it. Makes sense. Thanks for the quick response!

5 years, 6 months ago
Stefan van den Dungen Gronovius
Developer

You’re welcome.
I will close this topic

5 years, 6 months ago

You must be logged in to reply to this topic.