Any progress on this one: Database error!

Home Forums Calendar Products Events Calendar PRO Any progress on this one: Database error!

  • This topic has 19 replies, 2 voices, and was last updated 6 years ago by Ilkka.
Viewing 15 posts - 1 through 15 (of 19 total)
  • Author
    Posts
  • #1487641
    Ilkka
    Participant

    Hi, we have been having this error for a while and i found also another discussion about it. Any news on this as it its piling my server log with errors.

    https://theeventscalendar.com/support/forums/topic/database-error-unknown-column-wp_postmeta-meta_value-in-field-list/#dl_post-1399549

    WordPress database error Unknown column ‘wp_postmeta.meta_value’ in ‘field list’ for query SELECT DISTINCT wp_posts.*, MIN(wp_postmeta.meta_value) as EventStartDate, MIN(tribe_event_end_date.meta_value) as EventEndDate FROM wp_posts LEFT JOIN wp_term_relationships ON (wp_posts.ID = wp_term_relationships.object_id) LEFT JOIN wp_postmeta as tribe_event_end_date ON ( wp_posts.ID = tribe_event_end_date.post_id AND tribe_event_end_date.meta_key = ‘_EventEndDateUTC’ ) WHERE 1=1 AND….

    Is there any news on fixing this.

    thanks

    #1488309
    Ilkka
    Participant

    Hi,

    This problem is caused by this:

    /**
    * Sets the default date for event queries.
    *
    * Expects to be called during tribe_events_pre_get_posts. Note that this
    * function modifies $_REQUEST – this is needed for consistency because
    * various parts of TEC inspect that array directly to determine the current
    * date.
    *
    * @param WP_Query $query
    */
    function tribe_force_event_date( WP_Query $query ) {
    // Don’t touch single posts or queries other than the main query
    if ( ! $query->is_main_query() || is_single() ) {
    return;
    }
    // If a date has already been set by some other means, bail out
    if ( strlen( $query->get( ‘eventDate’ ) ) || ! empty( $_REQUEST[‘tribe-bar-date’] ) ) {
    return;
    }
    // Change this to whatever date you prefer
    $default_date = ‘2017-08’;
    // Use the preferred default date
    $query->set( ‘eventDate’, $default_date );
    $query->set( ‘start_date’, $default_date );
    $_REQUEST[‘tribe-bar-date’] = $default_date;
    }
    add_action( ‘tribe_events_pre_get_posts’, ‘tribe_force_event_date’ );

    This is found on here:

    https://theeventscalendar.com/support/forums/topic/show-specific-month-on-events-calendar/

    Which leads us to the next problem. How can we fast forward our calendar to the date where is available events.

    thanks

    #1488311
    Ilkka
    Participant

    Hi, Okay my above comment is not totally true. We have modified this with the following:

    $next_event = tribe_get_events( array(
    ‘posts_per_page’ => 1,
    ‘start_date’ => date( ‘Y-m-d H:i:s’ ),
    ‘tag__not_in’ => array(41),
    ‘tax_query’ => array(
    array(
    ‘taxonomy’=>‘tribe_events_cat’,
    ‘field’=>‘slug’,
    ‘terms’ => $current_category
    )
    )
    ));

    And this will lead to problems. Everything will work just will give error log. So any ideas how we could get our calender to the month that has events and after the current date.

    Thanks.

    #1488475

    Hi Ilkka,

    Thanks so much for reaching out here!

    As a first troubleshooting step, could you please provide us with your complete system information in a private reply using the instructions found in the following link?

    https://theeventscalendar.com/knowledgebase/sharing-sys-info/

    Let me know if anything else comes up in the meantime!

     

    Thanks,

    Jaime

    #1488672
    Ilkka
    Participant

    Hi,

    We dont have this problem as we stripped the code. The only problem we are facing is that we can not forward the calendar to a current date with events or to next date having events. We can set the default date, but as this has passed, it is really not the best idea to have the default date. If we do not define the default date it will just go to current date with no events. Which is confusing to our customers.

    Thanks

    #1488682
    Ilkka
    Participant

    This reply is private.

    #1489344

    Hi Ilkka,

    Thanks for providing me with that information.

    As a next step, let’s try to rule out if there is some type of conflict at play.
    This is usually because of:

    1.    A conflict with another plugin

    2.    A conflict with your WordPress theme

    3.    A template customization for the Events Calendar that requires updating

    When it comes to that type of issue, it is preferable to troubleshoot in a staging environment if you have one.

    A first quick test is to simply temporarily revert back to a default WordPress theme such as twenty-sixteen to see if the issue persists.

    The next step would be to go through our testing for conflicts procedure and let us know what you find out.

    Basically the goal here is to revert back to a bare WordPress installation to see if the problem persists. It also allows us to pinpoint what the cause of the issue is.

    But, before you do that, there are 2 things I would advise:

    1.    Make a backup of your database

    2.    Consider activating a “Maintenance Page” plugin if you are doing this on your live site (to minimize impact on your visitors)

    Let me know how that goes!

     

    Thanks,

    Jaime

    #1489351
    Ilkka
    Participant

    Hi,

    We do not have any conflicts. Everything is working like it should be. The only problem being that events calendar will always open the calendar from the current date in month view. And we have situations that there is no events in the current date. And this is strange for the customer because it have to start looking for months that has events.

    This is our problem. nothing else.

    thanks

    #1489360
    Ilkka
    Participant

    Hi, One addition. We believe that is how the events calendar is working or is it not?

    #1489364

    Hi Ilkka,

    Unfortunately I cannot view the issue in action, as your site is password-protected.  I would recommend checking out our demo site, and view in month view, so that you can see what the functionality is supposed to be.

    https://wpshindig.com

    The issue that you linked to above was related to a plugin conflict, so that is why I asked for you to  go through our testing for conflicts procedure.

    Another option would be for you to install the third-party plugin, Health Check, which can mimic a bare WordPress install while your site visitors still see your site the way that it normally appears.

    Let me know how that goes!

     

    Thanks,

    Jaime

    #1489378
    Ilkka
    Participant

    Hi,

    Your example is working like it should be. The only problem being for those who do not have any events in march it will show blank. Try a category where you do not have any events in march and you will see what i mean.

    thanks

    #1490648

    Hi Ilkka,

    In other words, if you have a category page without any events within that category in the current month, then the previous and next arrows will not show up?  Are you displaying this category page with a shortcode?  If so, can you provide me with that shortcode so that I can try to replicate the issue on my end?

    Let me know if you have any other questions in the meantime!

     

    Thanks,

    Jaime

    #1490667
    Ilkka
    Participant

    Hi,

    Almost correctly now. Except that the next and prev month arrows are coming no problem with that. But for the customer this is confusing. We would like to always the calendar to open from a month that has events, not current date (if it does not have any events).

    thanks

    #1490847

    Hi Ilkka,

    Okay I understand now.  So you’d like the calendar to open on the month with events, rather than the current month?

    Are you looking for this functionality on the main calendar or when embedding a calendar view via shortcode?

    Just to let you know, we are limited by our Support Policy in how much we can help with customizations, but I will try to point you in the right direction.

    Let me know!

    Thanks,

    Jaime

    #1490860
    Ilkka
    Participant

    Hi, yes this is exactly what i want. I just need some directions for this one. I understand that you can not guide me through customisation.

    thanks.

Viewing 15 posts - 1 through 15 (of 19 total)
  • The topic ‘Any progress on this one: Database error!’ is closed to new replies.