Undefined property: wpdb_mysqli::$eo_venuemeta_primary_col

WordPress Event Management, Calendars & Registration Forums General Question Undefined property: wpdb_mysqli::$eo_venuemeta_primary_col

This topic contains 8 replies, has 4 voices, and was last updated by  Valentin Wittich 5 years ago.

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #20154

    Hello,

    I’m getting an empty event details page. I see this error in the debug log when I try to view the page:

    PHP Notice: Undefined property: wpdb_mysqli::$eo_venuemeta_primary_col in /Users/lynne/freightfinder/wp-includes/wp-db.php on line 675

    My WordPress version is: 4.3.1
    Event Organiser 2.13.6
    Event Organiser Front End Submission 1.3.0
    Event Organiser Pro 1.11.3
    The wp_eo_venuemeta data table exists in my db and has data in it.<br />
    Any ideas?

    Thanks,
    Lynne

    Lynne
    #20167

    Hi Lynne,

    I’m just posting an update here. We discussed this via e-mail and found that the warning appeared only on your development server, and even there you are no longer getting this error.

    Although its now working for you, we weren’t able to determine the actual cause of the bug, though I wonder if you may have opcache on your local installation which meant the property was not set.

    Our own automated tests and exploratory testing didn’t throw up any issues, however, if anyone comes across this issue please feel free to use report it here.

    Stephen Harris
    #23658

    Hi Stephen, I have come across this issue today on a development server (a Vagrant box running Ubuntu 14.04) running WordPress 4.5.3, Event Organiser 3.1.3 and Event Organiser Pro 1.11.7 along with Page Builder by SiteOrigin 2.4.10

    With WP_DEBUG set to TRUE, requests for the events archive /events/event page display a notice at the top of the page, ahead of the opening html tag:

    Notice: Undefined property: wpdb::$eo_venuemeta_primary_col in /var/www/html/wp-includes/wp-db.php on line 684

    If I deactivate the Event Organiser Pro plugin, the notice does not appear. If I deactivate the Page Builder by SiteOrigin plugin and activate the Event Organiser Pro plugin, again the notice does not appear.

    So it appears to be a conflict between Event Organiser Pro and Page Builder by SiteOrigin that is causing this in my case.

    Regards, David

    SRUC Webmaster
    #23759

    David,

    Apologies for the delay in getting back to you. I’ve looked into this the PageBuilder plugin is running a query on the widgets_init hook. This is before the init hook which is when custom post types, and the above property, is defined.

    I could put an early check in to prevent that warning, but really, that warning is perfectly: the plugin shouldn’t really be running queries that early on as it might lead to unexpected behaviour, that warning is indicative of that.

    If I ‘fix’ the warning then I cover up the fact that there is a potential issue.

    On production, of course, these warnings will not be visible. But if you want that warning suppressed in your testing environment:

    add_filter( 'widgets_init', function() {
      global $wpdb;
      $wpdb->eo_venuemeta_primary_col = false;
    } );  
    

    Of course, you ought to be wary of running code in your development environment that you don’t also run on live (unless you have also have a staging server).

    Stephen Harris
    #23891

    Hi Stephen, thanks for the explanation around this – I’ll feed back to the PageBuilder plugin devs.

    Regards, David

    SRUC Webmaster
    #23894

    For what its worth, the plug-in functionality – in this instance – is to provide dynamic widgets. So it’s likely that they cannot avoid running a query that early. They may be just relying that the database will be still ‘usable’ before then and aren’t too concerned that post types won’t have been registered.

    In this case, a table name is not yet defined until init. Looking at this again, there is, in theory, no reason why that variable could not be defined earlier, and I will look into whether there is a suitable hook to do so. However, this would also require an update to Event Organiser.

    In short, I will try to address this is in Event Organiser and Event Organiser Pro – but it will require an update to both to fix. I suspect PageBuilder will say that they there is no other way for them to provide that functionality. So, it might be best to suppress the error on your dev environment and wait for the updates. (There are bug-fix updates planned for both plug-ins the coming 7 days).

    Stephen Harris
    #33657

    Hi Stephen,

    I just run over the same issue on my staging system. I used the init action to get a list of all events. Is that hook to early?

    add_action('init', function() {
        $args = array(
            'post_type' => 'event',
            'post_status' => 'publish',
            'posts_per_page' => -1,,
            'group_events_by' => 'series'
        );
        $query = new WP_Query($args);
        // ...
    });
    

    My log returns of the new WP_Query() as origin of that issue.

    PHP Notice:  Undefined property: wpdb::$eo_venuemeta_primary_col in /wp-includes/wp-db.php on line 666
    PHP Stack trace:
    PHP   1. {main}() /index.php:0
    PHP   2. require() /index.php:17
    PHP   3. require_once() /wp-blog-header.php:13
    PHP   4. require_once() /wp-load.php:37
    PHP   5. require_once() /wp-config.php:139
    PHP   6. do_action() /wp-settings.php:505
    PHP   7. WP_Hook->do_action() /wp-includes/plugin.php:465
    PHP   8. WP_Hook->apply_filters() /wp-includes/class-wp-hook.php:310
    PHP   9. custom_vc_carousel_seminar_mapper() /wp-includes/class-wp-hook.php:286
    PHP  10. WP_Query->__construct() /wp-content/themes/custom/inc/shortcode/custom_carousel.php:771 // WP_Query()
    PHP  11. WP_Query->query() /wp-includes/class-wp-query.php:3496
    PHP  12. WP_Query->get_posts() /wp-includes/class-wp-query.php:3387
    PHP  13. apply_filters_ref_array() /wp-includes/class-wp-query.php:2727
    PHP  14. WP_Hook->apply_filters() /wp-includes/plugin.php:251
    PHP  15. _eventorganiser_event_distance_sort() /wp-includes/class-wp-hook.php:286
    PHP  16. wpdb->__get() /wp-content/plugins/event-organiser-pro/includes/advanced-queries.php:209
    

    Best regards,
    Valentin

    Valentin Wittich
    #33669

    Hi Valentin,

    If you set the priority to 12 or higher (i.e later) then it should work.

    Stephen Harris
    #33673

    Yes, that’s it, works like a charm.

    Thank you!

    Valentin Wittich
Viewing 9 posts - 1 through 9 (of 9 total)
To enable me to focus on Pro customers, only users who have a valid license for the Pro add-on may post new topics or replies in this forum. If you have a valid license, please log-in or register an account using the e-mail address you purchased the license with. If you don't you can purchase one here. Or there's always the WordPress repository forum.