Translated events do not show with [gd_event_listing] shortcode

This topic contains 4 replies, has 3 voices, and was last updated by  Alex Rollin 5 years, 11 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #429951

    tilt
    Full Member
    Post count: 7

    Dear Team,

    We are using WPML together with the Event Manager Add-on, and noted that events translated into secondary languages are not showing when using the [gd_event_listing] shortcode on secondary languages pages.

    From our investigation we noted that the [gd_event_listing] shortcode uses the geodir_get_widget_listings() function located in geodirectory-functions/general_functions.php.

    The geodir_get_widget_listings() function uses the following sql query to return events:

    SELECT wp_posts.*, wp_geodir_gd_event_detail.*, wp_geodir_event_schedule.* FROM wp_posts INNER JOIN wp_geodir_gd_event_detail ON (wp_geodir_gd_event_detail.post_id = wp_posts.ID) JOIN wp_icl_translations icl_t ON icl_t.element_id = wp_posts.ID INNER JOIN wp_geodir_event_schedule ON (wp_geodir_event_schedule.event_id = wp_posts.ID) WHERE 1=1 AND ( wp_posts.post_status = 'publish' ) AND wp_posts.post_type = 'gd_event' AND icl_t.language_code = 'es' AND icl_t.element_type = 'post_gd_event' GROUP BY wp_posts.ID ,wp_geodir_event_schedule.event_date ORDER BY wp_geodir_gd_event_detail.is_featured ASC, wp_geodir_event_schedule.event_date asc,wp_geodir_event_schedule.event_starttime asc , wp_geodir_gd_event_detail.is_featured asc, wp_posts.post_date desc, wp_posts.post_title ASC LIMIT 0, 2

    The problem in our view resides in the following join:

    INNER JOIN wp_geodir_event_schedule ON (wp_geodir_event_schedule.event_id = wp_posts.ID)

    Indeed wp_geodir_event_schedule only contains a line for the original event but no lines for the translated (or duplicated) events.

    Therefore wp_geodir_event_schedule.event_id cannot correspond to any translated wp_posts.ID .

    The above query can therefore only return empty results when used with secondary languages.

    Of course the gd_event CPT is set to ‘translatable’ in WPML settings just like our other CPTs.

    Is there any fix to the above?

    Many thanks and best regards,

    #429959

    Alex Rollin
    Moderator
    Post count: 27815

    A valid license is required to view this reply.

    You may need to login

    OR

    Buy either a Membership or valid license for this product.

    Thanks, Team GeoDirectory!

    #430209

    Kiran
    Moderator
    Post count: 7069

    A valid license is required to view this reply.

    You may need to login

    OR

    Buy either a Membership or valid license for this product.

    Thanks, Team GeoDirectory!

    #430319

    tilt
    Full Member
    Post count: 7

    A valid license is required to view this reply.

    You may need to login

    OR

    Buy either a Membership or valid license for this product.

    Thanks, Team GeoDirectory!

    #430351

    Alex Rollin
    Moderator
    Post count: 27815

    A valid license is required to view this reply.

    You may need to login

    OR

    Buy either a Membership or valid license for this product.

    Thanks, Team GeoDirectory!

Viewing 5 posts - 1 through 5 (of 5 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket