1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Fixed Error after clicking on Daily Statistics link in ACP

Discussion in 'Resolved Bug Reports' started by Pepelac, Oct 5, 2011.

  1. Pepelac

    Pepelac Well-Known Member

    I've got this.

    Fatal error: Call to a member function format() on a non-object in /sskipped/library/XenForo/Helper/Date.php on line 37
     
    Romchik® likes this.
  2. Kier

    Kier XenForo Developer Staff Member

    What version of PHP are you running?
     
  3. Romchik®

    Romchik® Well-Known Member

    I have 5.2.6 and same error on localhost.
     
  4. James

    James Well-Known Member

    date_format

    (PHP 5 >= 5.2.0)

    Should work for any version greater than or equal to 5.2.
     
  5. Alluidh

    Alluidh Well-Known Member

    The error occurs not only there, you'll be able to get it on a click on "Attachment Browser" and other parts too

    PHP Version 5.2.6-1+lenny10
     
  6. Pepelac

    Pepelac Well-Known Member

    I've tested it on my local machine on MAMP server with PHP 5.2.17 and on the production server with PHP 5.2.6-1+lenny9. In both cases I've got this error.

    On PHP 5.3.6 there is no such error.
     
  7. DSF

    DSF Well-Known Member

    Same error's with php version 5.2.4-2ubuntu5.17
     
  8. T.S.

    T.S. Member

    Same error... running PHP 5.2.12.
     
  9. Mike

    Mike XenForo Developer Staff Member

    Fixed. library/XenForo/Helper/Date.php, change:
    Code:
    $presets[$date->modify($presetData[0])->format('Y-m-d')] = new XenForo_Phrase($presetData[1]);
    to:
    Code:
    $date->modify($presetData[0]);
    $presets[$date->format('Y-m-d')] = new XenForo_Phrase($presetData[1]);
     
    Veer, GeeksChat, Hoffi and 12 others like this.
  10. Alluidh

    Alluidh Well-Known Member

    Confirm the fix ;)
     
    erich37 likes this.
  11. DSF

    DSF Well-Known Member

    It's ok now ;)
     
    erich37 likes this.
  12. Dodgeboard

    Dodgeboard Well-Known Member

    Fixed for me too!
     
  13. Dodgeboard

    Dodgeboard Well-Known Member

    FYI: This fix also corrected an Undefined Offset error with Coreys XForcast.php XenPorta module that displays weather forcasts.
     
  14. EasyTarget

    EasyTarget Well-Known Member

    For some reason although you should be able to chain function calls, php sometimes has a problem when chaining inside an array parameter. In php 5.3 the bug is fixed.
     

Share This Page