Jump to:

1835 Posts in 1139 Topics by 554 members

Blog Module

SilverStripe Forums » Blog Module » [Notice] Array to string conversion

Discuss the Blog Module.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 2484 Views
  • Media Contour
    Avatar
    Community Member
    33 Posts

    [Notice] Array to string conversion Link to this post

    Installed the blog module and I got an error that I found a fix for on this forum.

    Now I have this new error. How can I fix this?

    [Notice] Array to string conversion
    GET /fit/blog/?flush=1

    Line 16 in /Users/gforce/Desktop/Repository/fit/sapphire/core/model/fieldtypes/Date.php

    SOURCE

    class Date extends DBField {
       
       function setValue($value) {
        if( is_array( $value ) && $value['Day'] && $value['Month'] && $value['Year'] ) {
           $this->value = $value['Year'] . '-' . $value['Month'] . '-' . $value['Day'];
           return;
        }
       
        // Default to NZ date format - strtotime expects a US date
        if(ereg('^([0-9]+)/([0-9]+)/([0-9]+)$', $value, $parts))
           $value = "$parts[2]/$parts[1]/$parts[3]";
       
        if($value && is_string($value)) $this->value = date('Y-m-d', strtotime($value));
        else $value = null;
       }

  • keeny
    Avatar
    Community Member
    48 Posts

    Re: [Notice] Array to string conversion Link to this post

    Maybe check the database BlogEntry and BlogEntry_Live tables for blogs entries with Null or malformed dates?

  • Media Contour
    Avatar
    Community Member
    33 Posts

    Re: [Notice] Array to string conversion Link to this post

    I remember posting this.

    I know its no longer an issue though. Don't know how I fixed it though :\

    2484 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.