Missing Table Alias Causing meta_query to Fail

Home Forums Calendar Products Events Calendar PRO Missing Table Alias Causing meta_query to Fail

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #90447
    Bob
    Participant

    I’m running into the same problem that was originally brought up in WordPress database error Not unique table/alias. In my case, the error impacts a meta_query I’ve created that uses the value in a Tribe Events custom field to determine whether an Event should appear on my site’s home page.

    I think I see where the problem is, and I THINK it qualifies as a bug. It’s in function posts_join() in tribe-event-query.class. The join condition for $joins[‘event_start_date’] should use a table alias, but doesn’t. You can see what it should be doing in the join condition for $joins[‘event_end_date’] that immediately follows. That join condition correctly uses an alias (“as tribe_event_end_date”).

    I was able to get my meta query working again by adding the missing ‘tribe_event_start_date’ alias. (I also had to add it to function multi_type_posts_fields(), also in tribe-event-query.class. There may be other “downstream” places it needs to be added as well.)

    I’d appreciate your having development review this and, unless I’m missing something, make the necessary fix.

    Thanks.

    #91521
    Barry
    Member

    Hi Bob: there’s certainly an issue there and we’re aware of it – please accept our apologies for the inconvenience – but we can’t unfortunately offer up an immediate fix as some broader changes are in progress right now which have a bearing on this. However, it’s definitely on the tracker and is something we’re keen to fix as soon as we practicably can.

    #91829
    Bob
    Participant

    Thanks–glad to hear you know about it and a fix will be forthcoming as part of a broader change. It’s easy to fix in the short run–I just wouldn’t want to have to keep making the fix through future updates.

    #95333
    Leah
    Member

    Hi there,

    I’m happy to report that we have fixed this in our upcoming version 3.4. Keep an eye on your Plugins page for an update message! Thanks for your patience while we worked on this.

    Best,
    Leah

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Missing Table Alias Causing meta_query to Fail’ is closed to new replies.