Jump to:

23368 Posts in 18145 Topics by 2863 members

General Questions

SilverStripe Forums » General Questions » Undefined index: Folder_UnusedAssetsField

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

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

Page: 1 2
Go to End
Author Topic: 3315 Views
  • juandavidgc
    Avatar
    Community Member
    36 Posts

    Undefined index: Folder_UnusedAssetsField Link to this post

    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!

  • CrazyCoders
    Avatar
    Community Member
    32 Posts

    Re: Undefined index: Folder_UnusedAssetsField Link to this post

    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!

  • Taffy
    Avatar
    Community Member
    119 Posts

    Re: Undefined index: Folder_UnusedAssetsField Link to this post

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

  • CrazyCoders
    Avatar
    Community Member
    32 Posts

    Re: Undefined index: Folder_UnusedAssetsField Link to this post

    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

  • juandavidgc
    Avatar
    Community Member
    36 Posts

    Re: Undefined index: Folder_UnusedAssetsField Link to this post

    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!

  • Sam
    Avatar
    Administrator
    679 Posts

    Re: Undefined index: Folder_UnusedAssetsField Link to this post

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

  • juandavidgc
    Avatar
    Community Member
    36 Posts

    Re: Undefined index: Folder_UnusedAssetsField Link to this post

    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 ;)

  • Sam
    Avatar
    Administrator
    679 Posts

    Re: Undefined index: Folder_UnusedAssetsField Link to this post

    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

    3315 Views
Page: 1 2
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.