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.

Upgrading SilverStripe /

Ask questions about upgrading SilverStripe to the latest version.

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

Issue with assets admin after upgrading from 2.3.1 to 3.2.1


Go to End


5 Posts   1917 Views

Avatar
derteaser

Community Member, 2 Posts

9 February 2016 at 8:11am

Hi everybody,

after I finally managed to upgrade a rather old site to 3.2.1 I'm still facing an issue with the assets admin. I always get the following error message when calling /admin/assets/:

Error at framework/core/Object.php line 739: Uncaught Exception: Object->__call(): the method 'numchildfolders' does not exist on 'Image' (http://www.diakonischeswerk.de/admin/assets/)

Any ideas on that? It seems pretty obvious that an Image doesn't have child folders, but why is that method called?

Thanks in advance
Jens

Avatar
helenclarko

Community Member, 166 Posts

9 February 2016 at 2:59pm

Edited: 09/02/2016 3:21pm

Hi Jens,

Do you have more info on the error?

I have only found one other person who has mentioned this error, it seems to be in releation to old code when upgrading.
Looks like something to do with loading images into/through a gridfield... Does that sound like anything?

-helenclarko

Avatar
derteaser

Community Member, 2 Posts

13 February 2016 at 3:30am

Edited: 13/02/2016 4:01am

Hi Helen,

thank you for your reply. I'm definitely not loading these images to a grid field. The error occurs when the default asset management of the CMS gets called. There is no custom code in it as far as I can see. The class Image is the one provided by the framework.

Here's stack trace I receive:

[User Error] Uncaught Exception: Object->__call(): the method 'numchildfolders' does not exist on 'Image'
Line 739 in /htdocs/diakonischeswerk-3.2.1/framework/core/Object.php
Source

730 				default :
731 					throw new Exception (
732 						"Object->__call(): extra method $method is invalid on $this->class:"
733 							. var_export($config, true)
734 					);
735 			}
736 		} else {
737 			// Please do not change the exception code number below.
738 			$class = get_class($this);
739 			throw new Exception("Object->__call(): the method '$method' does not exist on '$class'", 2175);
740 		}
741 	}
742 
743 	// --------------------------------------------------------------------------------------------------------------
744 
745 	/**

Trace
Object->__call(numChildFolders,Array)
Hierarchy.php:298
Image->numChildFolders()
Hierarchy.php:298
Hierarchy->markingFinished(numChildFolders)
Hierarchy.php:107
Hierarchy->getChildrenAsUL(,Closure,CMSPagesController,1,ChildFolders,numChildFolders,30,Closure)
call_user_func_array(Array,Array)
Object.php:707
Object->__call(getChildrenAsUL,Array)
LeftAndMain.php:916
Folder->getChildrenAsUL(,Closure,CMSPagesController,1,ChildFolders,numChildFolders,30,Closure)
LeftAndMain.php:916
LeftAndMain->getSiteTreeFor(Folder,,ChildFolders,numChildFolders,,30)
AssetAdmin.php:538
AssetAdmin->getSiteTreeFor(Folder,,ChildFolders,numChildFolders)
AssetAdmin.php:546
AssetAdmin->SiteTreeAsUL()
AssetAdmin.php:287
AssetAdmin->getEditForm()
LeftAndMain.php:1189
LeftAndMain->EditForm()
ViewableData.php:402
ViewableData->obj(EditForm,,1,,)
SSViewer.php:91
SSViewer_Scope->getObj(EditForm,,1,,)
SSViewer.php:525
SSViewer_DataPresenter->getObj(EditForm,,1,,)
SSViewer.php:111
SSViewer_Scope->obj(EditForm,,1)
.cache.cms.templates.Includes.AssetAdmin_Content.ss:9
include(/homepages/25/d106632873/htdocs/diakonischeswerk-3.2.1/silverstripe-cache/u36684509/.cache.cms.templates.Includes.AssetAdmin_Content.ss)
SSViewer.php:1059
SSViewer->includeGeneratedTemplate(/homepages/25/d106632873/htdocs/diakonischeswerk-3.2.1/silverstripe-cache/u36684509/.cache.cms.templates.Includes.AssetAdmin_Content.ss,AssetAdmin,,Array,)
SSViewer.php:1119
SSViewer->process(AssetAdmin,)
ViewableData.php:341
ViewableData->renderWith(Array)
LeftAndMain.php:722
LeftAndMain->Content()
ViewableData.php:402
ViewableData->obj(Content,,,1)
ViewableData.php:475
ViewableData->XML_val(Content,,1)
call_user_func_array(Array,Array)
SSViewer.php:179
SSViewer_Scope->__call(XML_val,Array)
SSViewer.php:550
SSViewer_DataPresenter->__call(XML_val,Array)
.cache.framework.admin.templates.LeftAndMain.ss:41
SSViewer_DataPresenter->XML_val(Content,,1)
.cache.framework.admin.templates.LeftAndMain.ss:41
include(/homepages/25/d106632873/htdocs/diakonischeswerk-3.2.1/silverstripe-cache/u36684509/.cache.framework.admin.templates.LeftAndMain.ss)
SSViewer.php:1059
SSViewer->includeGeneratedTemplate(/homepages/25/d106632873/htdocs/diakonischeswerk-3.2.1/silverstripe-cache/u36684509/.cache.framework.admin.templates.LeftAndMain.ss,AssetAdmin,,Array,)
SSViewer.php:1119
SSViewer->process(AssetAdmin,)
ViewableData.php:341
ViewableData->renderWith(SSViewer)
LeftAndMain.php:599
LeftAndMain->{closure}()
call_user_func(Closure)
PjaxResponseNegotiator.php:82
PjaxResponseNegotiator->respond(SS_HTTPRequest)
LeftAndMain.php:505
LeftAndMain->index(SS_HTTPRequest)
RequestHandler.php:288
RequestHandler->handleAction(SS_HTTPRequest,index)
Controller.php:200
Controller->handleAction(SS_HTTPRequest,index)
RequestHandler.php:200
RequestHandler->handleRequest(SS_HTTPRequest,DataModel)
Controller.php:157
Controller->handleRequest(SS_HTTPRequest,DataModel)
LeftAndMain.php:451
LeftAndMain->handleRequest(SS_HTTPRequest,DataModel)
AdminRootController.php:93
AdminRootController->handleRequest(SS_HTTPRequest,DataModel)
Director.php:385
Director::handleRequest(SS_HTTPRequest,Session,DataModel)
Director.php:149
Director::direct(/admin/assets/,DataModel)
main.php:184

Thanks again
Jens

Avatar
stefan.wunderweiss

Community Member, 2 Posts

30 March 2016 at 1:18am

I've the same issue when I try to upgrade from 3.1.12 to 3.1.18!
This seems to be a bug related to changes committed here: https://github.com/silverstripe/silverstripe-framework/pull/4202

It looks like that if there are files in the root of the assets tree (and maybe some other factors), this error occurs.

Avatar
stefan.wunderweiss

Community Member, 2 Posts

30 March 2016 at 1:39am

fyi: I've just created an issue on github: https://github.com/silverstripe/silverstripe-framework/issues/5245