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

Undefined index: Folder_UnusedAssetsField


Go to End


14 Posts   5140 Views

Avatar
juandavidgc

Community Member, 36 Posts

23 June 2009 at 2:45am

Hey everybody!

I have a problem. I installed the latest version (2.3.2), but i have a problem. When i try to get into Files and images in admin section, i get this error:

Undefined index: Folder_UnusedAssetsField
IN POST /admin/assets/getitem?ID=1&ajax=1
Line 157 in /var/www/vhosts/mysite.com/httpdocs/sapphire/core/ClassInfo.php

Anyone can help me? Thanks!

Avatar
CrazyCoders

Community Member, 32 Posts

23 June 2009 at 3:31am

Have you tried to rebuild the database? On each upgrade you may have new fields in the database objects so calling http://www.mysite.com/db/build?flush=1 is very important or you may mess up something!

Avatar
Taffy

Community Member, 119 Posts

23 June 2009 at 3:36am

Quick note: Version 2.2.X was /db/build/ - Version 2.3.X is /dev/build/

Avatar
CrazyCoders

Community Member, 32 Posts

23 June 2009 at 3:42am

Ahhhh, i knew it! I got trained like 2 weeks ago and the guy kept telling me to use /db/build and i said to him it was /dev/build. I guess both works but the new standard is /dev/build now!

Thanks

Avatar
juandavidgc

Community Member, 36 Posts

23 June 2009 at 3:55am

Hey guys! Thanks for your respond!!

I tried with /dev/build but i got the same error. I dont know what else to do, do you have some ideas ?

Thanks!

Avatar
Sam

Administrator, 690 Posts

23 June 2009 at 7:55pm

Try visiting the files & images section as admin/assets?flush=1

Avatar
juandavidgc

Community Member, 36 Posts

24 June 2009 at 12:19am

Hey Sam!

Well, i tried that but nothing, i got the same error.

I changed the files "AssetAdmin.php" and "AssetTableField.php" for a past version of silver files, and now i can get into files and images now, but when i made clic in Assets, i got an alert like this:

ERROR [Notice]: Undefined index: Folder_UnusedAssetsField
IN POST /admin/assets/getitem?ID=1&ajax=1
Line 157 in /var/www/vhosts/mysite.com/httpdocs/sapphire/core/ClassInfo.php

Source
======
148: /**
149: * @todo Improve documentation
150: */
151: static function ancestry($class, $onlyWithTables = false) {
152: global $_ALL_CLASSES;
153:
154: if(is_object($class)) $class = $class->class;
155: else if(!is_string($class)) user_error("Bad class value " . var_export($class, true) . " passed to
ClassInfo::ancestry()", E_USER_WARNING);
156:
* 157: $items = $_ALL_CLASSES['parents'][$class];
158: $items[$class] = $class;
159: if($onlyWithTables) foreach($items as $item) {
160: if(!DataObject::has_own_table($item)) unset($items[$item]);
161: }
162: return $items;
163: }

<ul>ClassInfo::ancestry(Folder_UnusedAssetsField)
line 451 of Object.php

Object->__construct()
line 42 of CompositeField.php

CompositeField->__construct(FieldSet)
line 429 of Folder.php

Folder_UnusedAssetsField->__construct(Folder)
line 356 of Folder.php

Folder->getCMSFields()
line 268 of AssetAdmin.php

AssetAdmin->getEditForm(1)
line 925 of LeftAndMain.php

LeftAndMain->EditForm()
line 380 of LeftAndMain.php

LeftAndMain->getitem(HTTPRequest)
line 162 of Controller.php

Controller->handleAction(HTTPRequest)
line 129 of RequestHandler.php

RequestHandler->handleRequest(HTTPRequest)
line 122 of Controller.php

Controller->handleRequest(HTTPRequest)
line 277 of Director.php

Director::handleRequest(HTTPRequest,Session)
line 121 of Director.php

Director::direct(/admin/assets/getitem)
line 118 of main.php

</ul>

Thanks for your help, and sorry my english isn't good ;)

Avatar
Sam

Administrator, 690 Posts

24 June 2009 at 12:57pm

Hi Juan,

Replacing the files with older versions of the files isn't going to be a good idea.

However, try putting the proper files back there and making a trivial edit to the file (eg, add an extra line of whitespace) and saving them, and see if that works.

I think we've got a bug in a piece of code that detects whether code files are changed. I've posted it here: http://open.silverstripe.com/ticket/4288

Go to Top