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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Line 426 in sapphire/core/model/MySQLDatabase.php


Go to End


1549 Views

Avatar
Tonyair

Community Member, 81 Posts

4 July 2010 at 7:58pm

Edited: 04/07/2010 8:00pm

Hello, I'm just updated SS to rev. 107443

And now after http://127.0.0.1/stable/dev/build?flush=1

I'm getting those notice:

[Notice] Undefined offset: 1
GET /stable/dev/build?flush=1

Line 426 in /home/a2nt/work/www/stable/sapphire/core/model/MySQLDatabase.php

Source

417 	 * @param string $indexName
418 	 * @param string|array $indexSpec See {@link requireTable()} for details
419 	 * @return string MySQL compatible ALTER TABLE syntax
420 	 */
421 	protected function getIndexSqlDefinition($indexName, $indexSpec=null) {
422 	
423 		$indexSpec=$this->convertIndexSpec($indexSpec);
424 		
425 		$indexSpec = trim($indexSpec);
426 		if($indexSpec[0] != '(') list($indexType, $indexFields) = explode(' ',$indexSpec,2);
427 	    else $indexFields = $indexSpec;
428 	    
429 	    if(!isset($indexType))
430 			$indexType = "index";
431 		
432 		if($indexType=='using')
Trace

MySQLDatabase->getIndexSqlDefinition(Uniques,Unique('URLSegment')) 
Line 225 of MySQLDatabase.php
MySQLDatabase->createTable(Page,Array,Array,Array,) 
Line 181 of Database.php
SS_Database->endSchemaUpdate() 
Line 213 of DatabaseAdmin.php
DatabaseAdmin->doBuild(,1) 
Line 105 of DatabaseAdmin.php
DatabaseAdmin->build(SS_HTTPRequest) 
Line 193 of Controller.php
Controller->handleAction(SS_HTTPRequest) 
Line 137 of RequestHandler.php
RequestHandler->handleRequest(SS_HTTPRequest) 
Line 147 of Controller.php
Controller->handleRequest(SS_HTTPRequest) 
Line 134 of DevelopmentAdmin.php
DevelopmentAdmin->build(SS_HTTPRequest) 
Line 137 of RequestHandler.php
RequestHandler->handleRequest(SS_HTTPRequest) 
Line 147 of Controller.php
Controller->handleRequest(SS_HTTPRequest) 
Line 283 of Director.php
Director::handleRequest(SS_HTTPRequest,Session) 
Line 127 of Director.php
Director::direct(/dev/build) 
Line 127 of main.php

And I think that as the result ShowInTopMenu described below column isn't created.

class Page extends SiteTree {

	public static $db = array(
		"ShowInTopMenu" => "Boolean"
	);

	public static $has_one = array(
		"Sidebar" => "WidgetArea",
	);
	static $indexes = array(
		"SearchFields" => "fulltext (Title, MenuTitle, Content, MetaTitle, MetaDescription, MetaKeywords)",
		"TitleSearchFields" => "fulltext (Title)",
		"Sort" => true,
		"Uniques" => "Unique('URLSegment')",
	);
	static $searchable_fields = array(
		
			'Title' => "PartialMatchFilter",
			'Content' => "PartialMatchFilter",
			'MenuTitle' => "PartialMatchFilter",
			'Content' => "PartialMatchFilter",
			'URLSegment' => "PartialMatchFilter"
		
	);
	//Show in search results
	static $summary_fields = array(
		'Title',
		'Menu',
		'Content'
	);
	function getCMSFields() {
		$fields = parent::getCMSFields();
		$fields->addFieldToTab("Root.Content.Widgets", new WidgetAreaEditor("Sidebar"), "ShowInTopMenu", "Show in top menu ");
		return $fields;
	}
}