Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Upgrading SilverStripe /

Ask questions about upgrading SilverStripe to the latest version.

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

SIlverstripe 3.0 -> 3.1 issues


Reply


5 Posts   1890 Views

Avatar
freakout

Community Member, 49 Posts

15 October 2013 at 1:12am

After Update to 3.1 i have PHP Fatal Errors within this controller:

class Index_Controller extends Page_Controller {
function Slides($iselector) {
$result = new DataObjectSet();
foreach (array('-1', '-2', '-3','-4', '-5', '-6') as $picno) {
$picjpg = $iselector . $picno . '.jpg';
if ($file = DataObject::get_one("File", "Name = '$picjpg'")) {
$result->push(new ArrayData( array('Iurl' => '/' . $file->Filename, 'Itext' => str_replace('&', '<span class="lighter$
}
}
return $result;
}
}

=> PHP Fatal error: Class 'DataObjectSet' not found

when i disable this controller i get:

=> PHP Fatal error: Access level to ErrorPage::$db must be public (as in class Page)
in /opt/silverstripe-3.1.1-1/cms/code/model/ErrorPage.php on line 14

Please help. Thanks

Avatar
kinglozzer

Community Member, 166 Posts

15 October 2013 at 2:30am

DataObjectSet doesn't exist any more - you should replace it (for your example) with ArrayList.

As for your second fatal error, you need to change your 'public static $db' to be 'private static' in all your Page/DataObject classes. See the upgrade docs here: http://doc.silverstripe.org/framework/en/changelogs/3.1.0#upgrading

Avatar
beren

Community Member, 9 Posts

8 November 2013 at 9:32pm

Edited: 08/11/2013 11:36pm

Hi,

I won't duplicate topics as i also have problem after upgrading to 3.1

If possible please help ;)

Server: Apache/2.2.15 (Unix) , on Centos 6.4 (Final), PHP 5.3.3

1. On some page templates I have errors on site

[Notice] Undefined index: close
GET /downloads/
Line 232 in /var/www/html/tessel/framework/parsers/ShortcodeParser.php
Source
223             }
224             }
225             
226             // And store the indexes, tag details, etc
227             $tags[] = array(
228                'text' => $match[0][0],
229                's' => $match[0][1],
230                'e' => $match[0][1] + strlen($match[0][0]),
231                'open' => @$match['open'][0],
232                'close' => @$match['close'][0],
233                'attrs' => $attrs,
234                'content' => '',
235                'escaped' => !empty($match['oesc'][0]) || !empty($match['cesc1'][0]) || !empty($match['cesc2'][0])
236             );
237          }
238          }

The part of template that generates this error is:

   <div id="tab-content">
               <div id="tab1_content"><br />$AAA</div>
               <div id="tab2_content"><br />$BBB</div>
               <div id="tab3_content"><br />$CCC</div>
               <div id="tab4_content"><br />$DDD</div>
               <div id="tab5_content"><br />$EEE</div>
               <div id="tab6_content"><br />$FFF</div>
   
            </div>

Those are all HTMLText defined in .php:

<?php

class Downloads extends SiteTree {
static $db = array(
   'BBB' => 'HTMLText',
   'CCC' => 'HTMLText',
   'DDD' => 'HTMLText',
   'EEE' => 'HTMLText',
   'FFF' => 'HTMLText'

);
static $has_one = array(
);
function getCMSFields() {
      $fields = parent::getCMSFields();
      $fields->addFieldToTab('Root.Content.Main', new HTMLEditorField('BBB', 'BBB tab'));
      $fields->addFieldToTab('Root.Content.Main', new HTMLEditorField('CCC', 'CCC tab'));
      $fields->addFieldToTab('Root.Content.Main', new HTMLEditorField('DDD', 'DDD tab'));
      $fields->addFieldToTab('Root.Content.Main', new HTMLEditorField('EEE', 'EEE tab'));
      $fields->addFieldToTab('Root.Content.Main', new HTMLEditorField('FFF', 'FFF tab'));
      
return $fields;
}

}

class Downloads_Controller extends ContentController {
function init() {
parent::init();

}
}

?>

Does it have something to do with "default_cast is now Text" from http://doc.silverstripe.org/framework/en/changelogs/3.1.0#upgrading?

2. Also on Admin site I can't edit pages as I got pop up massage of:

Notice at line 174 of /var/www/html/tessel/framework/dev/Deprecation.php

Some pages work just fine. I've very similar template but with only two additional HTMLEditorField and it works.
Is the content corrupted?

Anyone can help? If more info needed, please ask.

Thank in advance.

Avatar
beren

Community Member, 9 Posts

19 November 2013 at 2:36am

Anyyyoneeee?

Avatar
beren

Community Member, 9 Posts

29 November 2013 at 12:43am

Edited: 29/11/2013 3:22am

Trying to go through my problem, I've connected with other SS instance to same database to be able to edit content.
This SS do not have any problems as described - it's 3.0.2 version tho.
Problem is present with 3.1.1

Thanks to that i was able to identify that my link gained class="ss-broken" for some reason.

<a class="ss-broken" href="[sitetree_link,id=1]">

This is why i had this "[Notice] Undefined index: close " errors on site. Links that couse problem are only to other pages on this site. External links or linking to same page via anchors works fine.
When i unlink and than again do same linking using SS editor, the link will work but (no class="ss-broken") the errors will be still present.
They dissapear when I delete the link at all.

But still on 3.1.1 in admin site I cannot edit most pages - as in point 2 of my previous post.

EDIT: Link that works fine for me is:

Seems like a link should look like:
<a title="Contact Page" href="Contact">Contact</a> to work

but this i have to put in html editor by myself.