dynamic / silverstripe-maintenance-mode

Maintainance/Offline Mode Module for SilverStripe
BSD 2-Clause "Simplified" License
21 stars 18 forks source link

Issue when trying to access utility page admin menu #23

Closed sajansharmanz closed 8 years ago

sajansharmanz commented 8 years ago

Hi there,

I am using Silverstripe 3.3.1-rc1 for both the CMS & Framework. When I use this module and try to access the Utility page from the site tree i am getting the following error:

Error at line 168 of C:\wamp\www\mysitename\framework\forms\CompositeField.php

Firesphere commented 8 years ago

Could you post a stacktrace? When you get the error, refresh the page and you should get the full stack.

sajansharmanz commented 8 years ago

The SS_Backtrace shows the following:

Trace collateDataFields() I noticed that a field called 'NewComments' appears twice in your form: '(unknown form)'. One is a 'CommentsGridField' and the other is a 'CommentsGridField' CompositeField.php:168 CompositeField->collateDataFields(Array,) CompositeField.php:155 CompositeField->collateDataFields(Array,) CompositeField.php:155 CompositeField->collateDataFields(Array,) FieldList.php:68 FieldList->collateDataFields(Array) FieldList.php:52 FieldList->dataFields() FieldList.php:347 FieldList->dataFieldByName(ClassName) LeftAndMain.php:1224 LeftAndMain->getEditForm(12) CMSMain.php:601 CMSMain->getEditForm() LeftAndMain.php:1192 LeftAndMain->EditForm() ViewableData.php:421 ViewableData->obj(EditForm,,,1) ViewableData.php:494 ViewableData->XML_val(EditForm,,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.cms.templates.Includes.CMSMain_Content.ss:133 SSViewer_DataPresenter->XML_val(EditForm,,1) .cache.cms.templates.Includes.CMSMain_Content.ss:133 include(C:\Windows\Temp\silverstripe-cache-php5.5.12C--wamp-www-zahrahk\DESKTOP-UNG1UO1\.cache.cms.templates.Includes.CMSMain_Content.ss) SSViewer.php:1064 SSViewer->includeGeneratedTemplate(C:\WINDOWS\TEMP\silverstripe-cache-php5.5.12C--wamp-www-zahrahk\DESKTOP-UNG1UO1/.cache.cms.templates.Includes.CMSMain_Content.ss,CMSPageEditController,,Array,) SSViewer.php:1126 SSViewer->process(CMSPageEditController,) ViewableData.php:360 ViewableData->renderWith(Array) LeftAndMain.php:725 LeftAndMain->Content() ViewableData.php:421 ViewableData->obj(Content,,,1) ViewableData.php:494 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(C:\Windows\Temp\silverstripe-cache-php5.5.12C--wamp-www-zahrahk\DESKTOP-UNG1UO1\.cache.framework.admin.templates.LeftAndMain.ss) SSViewer.php:1064 SSViewer->includeGeneratedTemplate(C:\WINDOWS\TEMP\silverstripe-cache-php5.5.12C--wamp-www-zahrahk\DESKTOP-UNG1UO1/.cache.framework.admin.templates.LeftAndMain.ss,CMSPageEditController,,Array,) SSViewer.php:1126 SSViewer->process(CMSPageEditController,) ViewableData.php:360 ViewableData->renderWith(SSViewer) LeftAndMain.php:602 LeftAndMain->{closure}() call_user_func(Closure) PjaxResponseNegotiator.php:82 PjaxResponseNegotiator->respond(SS_HTTPRequest) LeftAndMain.php:579 LeftAndMain->show(SS_HTTPRequest) RequestHandler.php:288 RequestHandler->handleAction(SS_HTTPRequest,show) Controller.php:202 Controller->handleAction(SS_HTTPRequest,show) RequestHandler.php:200 RequestHandler->handleRequest(SS_HTTPRequest,DataModel) Controller.php:158 Controller->handleRequest(SS_HTTPRequest,DataModel) LeftAndMain.php:451 LeftAndMain->handleRequest(SS_HTTPRequest,DataModel) AdminRootController.php:92 AdminRootController->handleRequest(SS_HTTPRequest,DataModel) Director.php:385 Director::handleRequest(SS_HTTPRequest,Session,DataModel) Director.php:149 Director::direct(/admin/pages/edit/show/12,DataModel) main.php:184

Seems to be something with the setup of this module is clashing with something from the silverstripe comments module

Firesphere commented 8 years ago

From that trace, it seems you have declared a field twice. From any custom code, please try to rename NewComments to "MyNewComments"?

This issue is probably caused by SilverStripe not yet fully implementing namespaces, therefor clashes in field or classnames can occur.

It's too much a bulk right now to exactly point you to the where the issue occurs, but NewComments should be treated as reserved keyword for now probably.

If that's not it, I need to have a better look this weekend :)

sajansharmanz commented 8 years ago

Yea seems to be a double up of the NewComments field. I will have a look as soon as possible and try see where it is going wrong :)

Cheers

dljoseph commented 8 years ago

@sajansharmanz - so can this be closed as a non-issue?