Viewing 15 replies - 1 through 15 (of 16 total)
  • Hi Anton,

    Assuming the dates are displaying correctly in admin, there’s probably a problem with the date formatting. What code / formatting are you using?

    Thread Starter Anton

    (@nat0n)

    You know what? My web hotel, who also made the url above 404 for a while during a planned server migration, seems to have fixed the problem during said move ?? So I’ll close this one now.

    Thread Starter Anton

    (@nat0n)

    Well, whaddayaknow.. The problem just came back again. The listing in wp-admin looks correct though. The formatting code I use is “l j F, Y”.

    I’m running PHP 7, if that’s of importance here.

    Thread Starter Anton

    (@nat0n)

    Using debug=true I got this interesting bit:

    “Notice: Indirect modification of overloaded property EM_Event::$Array has no effect in /…/wp-content/plugins/events-manager/classes/em-object.php on line 1087”

    …plus tons of this:

    “Notice: Array to string conversion in /…/wp-content/plugins/events-manager/classes/em-object.php on line 1087”

    Any leads..?

    Are you able to test with a version 5 of PHP? I think PHP 7 could be the issue here.

    Thread Starter Anton

    (@nat0n)

    Yep, seems to work with php 5.6. How could that be?

    I’m not exactly sure why, other than there seems to be some substantial differences between PHP 5 and 7. I’ve passed this on to the Dev team.

    Thread Starter Anton

    (@nat0n)

    OK, thanks!

    FWIW, I found a similar issue with Joomla where one dev wrote:

    “PHP 7 throws an Array to string conversion error if you are accessing an object with a nested array using syntax like $object->$array[‘key’]; I haven’t researched the exact reason for this but the parser tries to convert the array to a string versus reading the array element. Wrapping the array in curly brackets (like $object->{$array[‘key’]}) allows the parser to interpret this correctly.”

    Great, thanks. I’ll pass that on…

    littlenoname

    (@littlenoname)

    Hi,

    I have the same problems with PHP 7.0.3. PHP 5 works correctly.
    The [events list grouped] shortcode works well in monthly mode. In daily mode it will show 1. Jan 1970 for all events.

    The problem seems to be at:
    Line 298: $events_dates[strtotime($EM_Event->start_date)][] = $EM_Event;
    in classes/em-events.php.

    Any suggestions?

    Thread Starter Anton

    (@nat0n)

    @littlenoname Great find! I hope I’m not rushing things now (due to some cache or whatever) but this modification of your code seems to work for me:

    $events_dates->{strtotime($EM_Event->start_date)}[] = $EM_Event;

    (Note the {} around the strtotime function)

    edit: Dang! 2 minutes later and the cache got updated.. still the same error :((

    littlenoname

    (@littlenoname)

    ok.
    there is a solution to fix that issue.
    I replaced the daily case code with the monthly case code and modified the date_format like this:

    $args[‘date_format’]:’j. F Y’;

    this works well.

    Thread Starter Anton

    (@nat0n)

    Confirmed. This hard coded solution works well for me too.

    Plugin Author Marcus (aka @msykes)

    (@netweblogic)

    Hi guys, we’re working on PHP7 compatibility issues and should have an update soon.

    Meantime, do you have a sample shortcode or PHP code that created this error for you? I’m testing out grouped events and the dates show up fine for me on php7.

    I can probably make a fix that’ll prevent the problem from happening for you, but it’d certainly be better if i can duplicate it myself (cannot for some reason)

    Plugin Author Marcus (aka @msykes)

    (@netweblogic)

    Hi All, the latest update should have fixed this.

    I’m going to mark this resolved because other threads have confirmed the issue is fixed, although we were never able to reproduce this ourselves strangely enough.

    Let us know if not (OP can unresolve the issue, otherwise we can) and if you can provide us with more info to reproduce that’d be appreciated.

Viewing 15 replies - 1 through 15 (of 16 total)
  • The topic ‘All events has 1970-01-01 on grouped listing’ is closed to new replies.