php - Silverstripe page template save to database issues -
been having few issues tab fields i've added not saving data placed in them. know has somehting $db array can't work without error when try /dev/build.
here code snippet. i'm trying add in 5 htmleditorfields below. i'm pretty new posts i've come across such these suggest i've got right?
http://www.silverstripe.org/customising-the-cms/show/4496
http://www.silverstripe.org/customising-the-cms/show/9391
http://www.silverstripe.org/general-questions/show/9001
i wonder if can point out issue might be?
<?php class homepage extends page { static $db = array( 'contentbottom' => 'htmltext', 'centertop' => 'htmltext', 'centerbottom' => 'htmltext', 'righttop' => 'htmltext', 'rightbottom' => 'htmltext' ); function getcmsfields() { $fields = parent::getcmsfields(); // content $fields->addfieldtotab('root.content.main', new htmleditorfield('contentbottom')); $fields->addfieldtotab('root.content.main', new htmleditorfield('centertop')); $fields->addfieldtotab('root.content.main', new htmleditorfield('centerbottom')); $fields->addfieldtotab('root.content.main', new htmleditorfield('righttop')); $fields->addfieldtotab('root.content.main', new htmleditorfield('rightbottom')); return $fields; } } class homepage_controller extends page_controller { public function init() { parent::init(); } } error:
[notice] array string conversion /<site_name>/dev/build line 396 in f:\programs\xampp\htdocs\<site_name>\sapphire\core\model\database.php source 387 $array_spec = $this->indexlist[$table][$index_alt]['spec']; 388 } else { 389 $array_spec = $this->indexlist[$table][$index_alt]; 390 } 391 } 392 } 393 394 if($newtable || !isset($this->indexlist[$table][$index_alt])) { 395 $this->transcreateindex($table, $index, $spec); 396 $this->alterationmessage("index $table.$index: created $spec","created"); 397 } else if($array_spec != db::getconn()->convertindexspec($spec)) { 398 $this->transalterindex($table, $index, $spec); 399 $spec_msg=db::getconn()->convertindexspec($spec); 400 $this->alterationmessage("index $table.$index: changed $spec_msg <i style=\"color: #aaa\">(from {$array_spec})</i>","changed"); 401 } 402 }
the issue here schellmax suggested, i've installed earlier version of xampp php 5.3 , it's working should now...
Comments
Post a Comment