UndefinedOffset / SortableGridField

Adds drag and drop functionality to Silverstripe's GridField
BSD 3-Clause "New" or "Revised" License
93 stars 62 forks source link

Couldn't run query: UPDATE "" SET "SortOrder" = 1 WHERE "" = 1 AND "" = 6 #131

Closed webspilka closed 3 years ago

webspilka commented 3 years ago

Affected Version

silverstripe/recipe-cms 4.7.3 tractorcow/silverstripe-fluent 5.0.0 undefinedoffset/sortablegridfield 2.0.8

Description

Tell me what could be the problem? I get error on PCategory page, after adding PEntry to PCategory.

[Emergency] Uncaught SilverStripe\ORM\Connect\DatabaseException: Couldn't run query: UPDATE "" SET "SortOrder" = 1 WHERE "" = 1 AND "" = 6 Incorrect table name ''
GET /admin/pages/edit/show/6
Line 64 in /var/www/vendor/silverstripe/framework/src/ORM/Connect/DBConnector.php

Steps to Reproduce

my code is https://gist.github.com/webspilka/6fbb98d032b23283665e597658be3a10

error codes:

[Notice] Trying to access array offset on value of type null
GET /admin/pages/edit/show/6
Line 259 in /var/www/vendor/undefinedoffset/sortablegridfield/src/Forms/GridFieldSortableRows.php

Source
250         $list = $list->filter($this->sortColumn, 0)->sort("Created,ID");
251         if ($list->Count() > 0) {
252             $owner = $gridField->getForm()->getRecord();
253             $sortColumn = $this->sortColumn;
254             $i = 1;
255 
256             if ($many_many) {
257                 $schema=Injector::inst()->get(DataObjectSchema::class);
258                 $componentDetails=$schema->manyManyComponent(get_class($owner), (!empty($this->custom_relation_name) ? $this->custom_relation_name : $gridField->getName()));
259                 $parentField=$componentDetails['parentField'];
260                 $componentField=$componentDetails['childField'];
261                 $table=$componentDetails['join'];
262                 
263                 //For ManyManyThroughLists get the right join table
264                 if ($list instanceof ManyManyThroughList && class_exists($table)) {
265                     $table=$schema->tableName($table);
Trace
Monolog\ErrorHandler->handleError(8, Trying to access array offset on value of type null, /var/www/vendor/undefinedoffset/sortablegridfield/src/Forms/GridFieldSortableRows.php, 259, Array)
GridFieldSortableRows.php:259
UndefinedOffset\SortableGridField\Forms\GridFieldSortableRows->fixSortColumn(SilverStripe\Forms\GridField\GridField, SilverStripe\ORM\ManyManyList)
GridFieldSortableRows.php:154
UndefinedOffset\SortableGridField\Forms\GridFieldSortableRows->getManipulatedData(SilverStripe\Forms\GridField\GridField, SilverStripe\ORM\ManyManyList)
GridField.php:394
SilverStripe\Forms\GridField\GridField->getManipulatedList()
GridField.php:427
SilverStripe\Forms\GridField\GridField->FieldHolder()
call_user_func_array(Array, Array)
ViewableData.php:485
SilverStripe\View\ViewableData->obj(FieldHolder, , 1)
ViewableData.php:547
SilverStripe\View\ViewableData->XML_val(FieldHolder, , 1)
SSViewer_Scope.php:323
SilverStripe\View\SSViewer_Scope->__call(XML_val, Array)
SSViewer_DataPresenter.php:309
SilverStripe\View\SSViewer_DataPresenter->__call(XML_val, Array)
.cachevendor.silverstripe.admin.themes.cms-forms.templates.SilverStripe.Forms.TabSet.ss:75
include(/tmp/silverstripe-cache-php7.4.12-var-www/www-data/.cachevendor.silverstripe.admin.themes.cms-forms.templates.SilverStripe.Forms.TabSet.ss)
SSViewer.php:602
SilverStripe\View\SSViewer->includeGeneratedTemplate(/tmp/silverstripe-cache-php7.4.12-var-www/www-data/.cachevendor.silverstripe.admin.themes.cms-forms.templates.SilverStripe.Forms.TabSet.ss, SilverStripe\Forms\TabSet, , Array, )
SSViewer.php:674
SilverStripe\View\SSViewer->process(SilverStripe\Forms\TabSet, )
ViewableData.php:401
SilverStripe\View\ViewableData->renderWith(SilverStripe\View\SSViewer)
TabSet.php:136
SilverStripe\Forms\TabSet->FieldHolder()
call_user_func_array(Array, Array)
ViewableData.php:485
SilverStripe\View\ViewableData->obj(FieldHolder, , 1)
ViewableData.php:547
SilverStripe\View\ViewableData->XML_val(FieldHolder, , 1)
SSViewer_Scope.php:323
SilverStripe\View\SSViewer_Scope->__call(XML_val, Array)
SSViewer_DataPresenter.php:309
SilverStripe\View\SSViewer_DataPresenter->__call(XML_val, Array)
.cachevendor.silverstripe.cms.templates.SilverStripe.CMS.Controllers.Includes.CMSMain_EditForm.ss:58
include(/tmp/silverstripe-cache-php7.4.12-var-www/www-data/.cachevendor.silverstripe.cms.templates.SilverStripe.CMS.Controllers.Includes.CMSMain_EditForm.ss)
SSViewer.php:602
SilverStripe\View\SSViewer->includeGeneratedTemplate(/tmp/silverstripe-cache-php7.4.12-var-www/www-data/.cachevendor.silverstripe.cms.templates.SilverStripe.CMS.Controllers.Includes.CMSMain_EditForm.ss, SilverStripe\Forms\Form, , Array, )
SSViewer.php:674
SilverStripe\View\SSViewer->process(SilverStripe\Forms\Form, )
ViewableData.php:401
SilverStripe\View\ViewableData->renderWith(SilverStripe\View\SSViewer)
Form.php:1603
SilverStripe\Forms\Form->forTemplate()
ViewableData.php:549
SilverStripe\View\ViewableData->XML_val(EditForm, , 1)
SSViewer_Scope.php:323
SilverStripe\View\SSViewer_Scope->__call(XML_val, Array)
SSViewer_DataPresenter.php:309
SilverStripe\View\SSViewer_DataPresenter->__call(XML_val, Array)
.cachevendor.silverstripe.cms.templates.SilverStripe.CMS.Controllers.Includes.CMSMain_Content.ss:97
include(/tmp/silverstripe-cache-php7.4.12-var-www/www-data/.cachevendor.silverstripe.cms.templates.SilverStripe.CMS.Controllers.Includes.CMSMain_Content.ss)
SSViewer.php:602
SilverStripe\View\SSViewer->includeGeneratedTemplate(/tmp/silverstripe-cache-php7.4.12-var-www/www-data/.cachevendor.silverstripe.cms.templates.SilverStripe.CMS.Controllers.Includes.CMSMain_Content.ss, SilverStripe\CMS\Controllers\CMSPageEditController, , Array, )
SSViewer.php:674
SilverStripe\View\SSViewer->process(SilverStripe\CMS\Controllers\CMSPageEditController, )
ViewableData.php:401
SilverStripe\View\ViewableData->renderWith(SilverStripe\View\SSViewer)
LeftAndMain.php:1138
SilverStripe\Admin\LeftAndMain->Content()
call_user_func_array(Array, Array)
ViewableData.php:485
SilverStripe\View\ViewableData->obj(Content, , 1)
ViewableData.php:547
SilverStripe\View\ViewableData->XML_val(Content, , 1)
SSViewer_Scope.php:323
SilverStripe\View\SSViewer_Scope->__call(XML_val, Array)
SSViewer_DataPresenter.php:309
SilverStripe\View\SSViewer_DataPresenter->__call(XML_val, Array)
.cachevendor.silverstripe.admin.templates.SilverStripe.Admin.LeftAndMain.ss:41
include(/tmp/silverstripe-cache-php7.4.12-var-www/www-data/.cachevendor.silverstripe.admin.templates.SilverStripe.Admin.LeftAndMain.ss)
SSViewer.php:602
SilverStripe\View\SSViewer->includeGeneratedTemplate(/tmp/silverstripe-cache-php7.4.12-var-www/www-data/.cachevendor.silverstripe.admin.templates.SilverStripe.Admin.LeftAndMain.ss, SilverStripe\CMS\Controllers\CMSPageEditController, , Array, )
SSViewer.php:674
SilverStripe\View\SSViewer->process(SilverStripe\CMS\Controllers\CMSPageEditController, )
ViewableData.php:401
SilverStripe\View\ViewableData->renderWith(SilverStripe\View\SSViewer)
LeftAndMain.php:994
SilverStripe\Admin\LeftAndMain->SilverStripe\Admin\{closure}()
call_user_func(Closure)
PjaxResponseNegotiator.php:92
SilverStripe\Control\PjaxResponseNegotiator->respond(SilverStripe\Control\HTTPRequest)
LeftAndMain.php:968
SilverStripe\Admin\LeftAndMain->show(SilverStripe\Control\HTTPRequest)
RequestHandler.php:323
SilverStripe\Control\RequestHandler->handleAction(SilverStripe\Control\HTTPRequest, show)
Controller.php:286
SilverStripe\Control\Controller->handleAction(SilverStripe\Control\HTTPRequest, show)
RequestHandler.php:202
SilverStripe\Control\RequestHandler->handleRequest(SilverStripe\Control\HTTPRequest)
Controller.php:212
SilverStripe\Control\Controller->handleRequest(SilverStripe\Control\HTTPRequest)
LeftAndMain.php:766
SilverStripe\Admin\LeftAndMain->handleRequest(SilverStripe\Control\HTTPRequest)
AdminRootController.php:123
SilverStripe\Admin\AdminRootController->handleRequest(SilverStripe\Control\HTTPRequest)
Director.php:360
SilverStripe\Control\Director->SilverStripe\Control\{closure}(SilverStripe\Control\HTTPRequest)
DetectLocaleMiddleware.php:122
TractorCow\Fluent\Middleware\DetectLocaleMiddleware->TractorCow\Fluent\Middleware\{closure}(TractorCow\Fluent\State\FluentState)
FluentState.php:152
TractorCow\Fluent\State\FluentState->withState(Closure)
DetectLocaleMiddleware.php:123
TractorCow\Fluent\Middleware\DetectLocaleMiddleware->process(SilverStripe\Control\HTTPRequest, Closure)
HTTPMiddlewareAware.php:62
SilverStripe\Control\Director->SilverStripe\Control\Middleware\{closure}(SilverStripe\Control\HTTPRequest)
InitStateMiddleware.php:51
TractorCow\Fluent\Middleware\InitStateMiddleware->TractorCow\Fluent\Middleware\{closure}(TractorCow\Fluent\State\FluentState)
FluentState.php:152
TractorCow\Fluent\State\FluentState->withState(Closure)
InitStateMiddleware.php:52
TractorCow\Fluent\Middleware\InitStateMiddleware->process(SilverStripe\Control\HTTPRequest, Closure)
HTTPMiddlewareAware.php:62
SilverStripe\Control\Director->SilverStripe\Control\Middleware\{closure}(SilverStripe\Control\HTTPRequest)
SEORequestProcessor.php:81
SilverStripers\SEO\Control\SEORequestProcessor->process(SilverStripe\Control\HTTPRequest, Closure)
HTTPMiddlewareAware.php:62
SilverStripe\Control\Director->SilverStripe\Control\Middleware\{closure}(SilverStripe\Control\HTTPRequest)
VersionedHTTPMiddleware.php:41
SilverStripe\Versioned\VersionedHTTPMiddleware->process(SilverStripe\Control\HTTPRequest, Closure)
HTTPMiddlewareAware.php:62
SilverStripe\Control\Director->SilverStripe\Control\Middleware\{closure}(SilverStripe\Control\HTTPRequest)
ConfirmationMiddleware.php:254
SilverStripe\Control\Middleware\ConfirmationMiddleware->process(SilverStripe\Control\HTTPRequest, Closure)
HTTPMiddlewareAware.php:62
SilverStripe\Control\Director->SilverStripe\Control\Middleware\{closure}(SilverStripe\Control\HTTPRequest)
ConfirmationMiddleware.php:254
SilverStripe\Control\Middleware\ConfirmationMiddleware->process(SilverStripe\Control\HTTPRequest, Closure)
HTTPMiddlewareAware.php:62
SilverStripe\Control\Director->SilverStripe\Control\Middleware\{closure}(SilverStripe\Control\HTTPRequest)
PasswordExpirationMiddleware.php:84
SilverStripe\Security\PasswordExpirationMiddleware->process(SilverStripe\Control\HTTPRequest, Closure)
HTTPMiddlewareAware.php:62
SilverStripe\Control\Director->SilverStripe\Control\Middleware\{closure}(SilverStripe\Control\HTTPRequest)
BasicAuthMiddleware.php:68
SilverStripe\Security\BasicAuthMiddleware->process(SilverStripe\Control\HTTPRequest, Closure)
HTTPMiddlewareAware.php:62
SilverStripe\Control\Director->SilverStripe\Control\Middleware\{closure}(SilverStripe\Control\HTTPRequest)
AuthenticationMiddleware.php:61
SilverStripe\Security\AuthenticationMiddleware->process(SilverStripe\Control\HTTPRequest, Closure)
HTTPMiddlewareAware.php:62
SilverStripe\Control\Director->SilverStripe\Control\Middleware\{closure}(SilverStripe\Control\HTTPRequest)
ExecMetricMiddleware.php:20
SilverStripe\Control\Middleware\ExecMetricMiddleware->process(SilverStripe\Control\HTTPRequest, Closure)
HTTPMiddlewareAware.php:62
SilverStripe\Control\Director->SilverStripe\Control\Middleware\{closure}(SilverStripe\Control\HTTPRequest)
CanonicalURLMiddleware.php:190
SilverStripe\Control\Middleware\CanonicalURLMiddleware->process(SilverStripe\Control\HTTPRequest, Closure)
HTTPMiddlewareAware.php:62
SilverStripe\Control\Director->SilverStripe\Control\Middleware\{closure}(SilverStripe\Control\HTTPRequest)
HTTPCacheControlMiddleware.php:42
SilverStripe\Control\Middleware\HTTPCacheControlMiddleware->process(SilverStripe\Control\HTTPRequest, Closure)
HTTPMiddlewareAware.php:62
SilverStripe\Control\Director->SilverStripe\Control\Middleware\{closure}(SilverStripe\Control\HTTPRequest)
ChangeDetectionMiddleware.php:28
SilverStripe\Control\Middleware\ChangeDetectionMiddleware->process(SilverStripe\Control\HTTPRequest, Closure)
HTTPMiddlewareAware.php:62
SilverStripe\Control\Director->SilverStripe\Control\Middleware\{closure}(SilverStripe\Control\HTTPRequest)
FlushMiddleware.php:27
SilverStripe\Control\Middleware\FlushMiddleware->process(SilverStripe\Control\HTTPRequest, Closure)
HTTPMiddlewareAware.php:62
SilverStripe\Control\Director->SilverStripe\Control\Middleware\{closure}(SilverStripe\Control\HTTPRequest)
RequestProcessor.php:66
SilverStripe\Control\RequestProcessor->process(SilverStripe\Control\HTTPRequest, Closure)
HTTPMiddlewareAware.php:62
SilverStripe\Control\Director->SilverStripe\Control\Middleware\{closure}(SilverStripe\Control\HTTPRequest)
SessionMiddleware.php:20
SilverStripe\Control\Middleware\SessionMiddleware->process(SilverStripe\Control\HTTPRequest, Closure)
HTTPMiddlewareAware.php:62
SilverStripe\Control\Director->SilverStripe\Control\Middleware\{closure}(SilverStripe\Control\HTTPRequest)
AllowedHostsMiddleware.php:60
SilverStripe\Control\Middleware\AllowedHostsMiddleware->process(SilverStripe\Control\HTTPRequest, Closure)
HTTPMiddlewareAware.php:62
SilverStripe\Control\Director->SilverStripe\Control\Middleware\{closure}(SilverStripe\Control\HTTPRequest)
TrustedProxyMiddleware.php:176
SilverStripe\Control\Middleware\TrustedProxyMiddleware->process(SilverStripe\Control\HTTPRequest, Closure)
HTTPMiddlewareAware.php:62
SilverStripe\Control\Director->SilverStripe\Control\Middleware\{closure}(SilverStripe\Control\HTTPRequest)
HTTPMiddlewareAware.php:65
SilverStripe\Control\Director->callMiddleware(SilverStripe\Control\HTTPRequest, Closure)
Director.php:369
SilverStripe\Control\Director->handleRequest(SilverStripe\Control\HTTPRequest)
HTTPApplication.php:117
SilverStripe\Control\HTTPApplication::SilverStripe\Control\{closure}(SilverStripe\Control\HTTPRequest)
call_user_func(Closure, SilverStripe\Control\HTTPRequest)
HTTPApplication.php:136
SilverStripe\Control\HTTPApplication->SilverStripe\Control\{closure}(SilverStripe\Control\HTTPRequest)
HTTPMiddlewareAware.php:65
SilverStripe\Control\HTTPApplication->callMiddleware(SilverStripe\Control\HTTPRequest, Closure)
HTTPApplication.php:137
SilverStripe\Control\HTTPApplication->execute(SilverStripe\Control\HTTPRequest, Closure, )
HTTPApplication.php:116
SilverStripe\Control\HTTPApplication->handle(SilverStripe\Control\HTTPRequest)
index.php:24
[Notice] Trying to access array offset on value of type null
GET /admin/pages/edit/show/6
Line 260 in /var/www/vendor/undefinedoffset/sortablegridfield/src/Forms/GridFieldSortableRows.php

Source
251         if ($list->Count() > 0) {
252             $owner = $gridField->getForm()->getRecord();
253             $sortColumn = $this->sortColumn;
254             $i = 1;
255 
256             if ($many_many) {
257                 $schema=Injector::inst()->get(DataObjectSchema::class);
258                 $componentDetails=$schema->manyManyComponent(get_class($owner), (!empty($this->custom_relation_name) ? $this->custom_relation_name : $gridField->getName()));
259                 $parentField=$componentDetails['parentField'];
260                 $componentField=$componentDetails['childField'];
261                 $table=$componentDetails['join'];
262                 
263                 //For ManyManyThroughLists get the right join table
264                 if ($list instanceof ManyManyThroughList && class_exists($table)) {
265                     $table=$schema->tableName($table);
266                 }
Trace
Monolog\ErrorHandler->handleError(8, Trying to access array offset on value of type null, /var/www/vendor/undefinedoffset/sortablegridfield/src/Forms/GridFieldSortableRows.php, 260, Array)
GridFieldSortableRows.php:260
UndefinedOffset\SortableGridField\Forms\GridFieldSortableRows->fixSortColumn(SilverStripe\Forms\GridField\GridField, SilverStripe\ORM\ManyManyList)
GridFieldSortableRows.php:154
UndefinedOffset\SortableGridField\Forms\GridFieldSortableRows->getManipulatedData(SilverStripe\Forms\GridField\GridField, SilverStripe\ORM\ManyManyList)
GridField.php:394
SilverStripe\Forms\GridField\GridField->getManipulatedList()
GridField.php:427
SilverStripe\Forms\GridField\GridField->FieldHolder()
call_user_func_array(Array, Array)
ViewableData.php:485
SilverStripe\View\ViewableData->obj(FieldHolder, , 1)
ViewableData.php:547
SilverStripe\View\ViewableData->XML_val(FieldHolder, , 1)
SSViewer_Scope.php:323
SilverStripe\View\SSViewer_Scope->__call(XML_val, Array)
SSViewer_DataPresenter.php:309
SilverStripe\View\SSViewer_DataPresenter->__call(XML_val, Array)
.cachevendor.silverstripe.admin.themes.cms-forms.templates.SilverStripe.Forms.TabSet.ss:75
include(/tmp/silverstripe-cache-php7.4.12-var-www/www-data/.cachevendor.silverstripe.admin.themes.cms-forms.templates.SilverStripe.Forms.TabSet.ss)
SSViewer.php:602
SilverStripe\View\SSViewer->includeGeneratedTemplate(/tmp/silverstripe-cache-php7.4.12-var-www/www-data/.cachevendor.silverstripe.admin.themes.cms-forms.templates.SilverStripe.Forms.TabSet.ss, SilverStripe\Forms\TabSet, , Array, )
SSViewer.php:674
SilverStripe\View\SSViewer->process(SilverStripe\Forms\TabSet, )
ViewableData.php:401
SilverStripe\View\ViewableData->renderWith(SilverStripe\View\SSViewer)
TabSet.php:136
SilverStripe\Forms\TabSet->FieldHolder()
call_user_func_array(Array, Array)
ViewableData.php:485
SilverStripe\View\ViewableData->obj(FieldHolder, , 1)
ViewableData.php:547
SilverStripe\View\ViewableData->XML_val(FieldHolder, , 1)
SSViewer_Scope.php:323
SilverStripe\View\SSViewer_Scope->__call(XML_val, Array)
SSViewer_DataPresenter.php:309
SilverStripe\View\SSViewer_DataPresenter->__call(XML_val, Array)
.cachevendor.silverstripe.cms.templates.SilverStripe.CMS.Controllers.Includes.CMSMain_EditForm.ss:58
include(/tmp/silverstripe-cache-php7.4.12-var-www/www-data/.cachevendor.silverstripe.cms.templates.SilverStripe.CMS.Controllers.Includes.CMSMain_EditForm.ss)
SSViewer.php:602
SilverStripe\View\SSViewer->includeGeneratedTemplate(/tmp/silverstripe-cache-php7.4.12-var-www/www-data/.cachevendor.silverstripe.cms.templates.SilverStripe.CMS.Controllers.Includes.CMSMain_EditForm.ss, SilverStripe\Forms\Form, , Array, )
SSViewer.php:674
SilverStripe\View\SSViewer->process(SilverStripe\Forms\Form, )
ViewableData.php:401
SilverStripe\View\ViewableData->renderWith(SilverStripe\View\SSViewer)
Form.php:1603
SilverStripe\Forms\Form->forTemplate()
ViewableData.php:549
SilverStripe\View\ViewableData->XML_val(EditForm, , 1)
SSViewer_Scope.php:323
SilverStripe\View\SSViewer_Scope->__call(XML_val, Array)
SSViewer_DataPresenter.php:309
SilverStripe\View\SSViewer_DataPresenter->__call(XML_val, Array)
.cachevendor.silverstripe.cms.templates.SilverStripe.CMS.Controllers.Includes.CMSMain_Content.ss:97
include(/tmp/silverstripe-cache-php7.4.12-var-www/www-data/.cachevendor.silverstripe.cms.templates.SilverStripe.CMS.Controllers.Includes.CMSMain_Content.ss)
SSViewer.php:602
SilverStripe\View\SSViewer->includeGeneratedTemplate(/tmp/silverstripe-cache-php7.4.12-var-www/www-data/.cachevendor.silverstripe.cms.templates.SilverStripe.CMS.Controllers.Includes.CMSMain_Content.ss, SilverStripe\CMS\Controllers\CMSPageEditController, , Array, )
SSViewer.php:674
SilverStripe\View\SSViewer->process(SilverStripe\CMS\Controllers\CMSPageEditController, )
ViewableData.php:401
SilverStripe\View\ViewableData->renderWith(SilverStripe\View\SSViewer)
LeftAndMain.php:1138
SilverStripe\Admin\LeftAndMain->Content()
call_user_func_array(Array, Array)
ViewableData.php:485
SilverStripe\View\ViewableData->obj(Content, , 1)
ViewableData.php:547
SilverStripe\View\ViewableData->XML_val(Content, , 1)
SSViewer_Scope.php:323
SilverStripe\View\SSViewer_Scope->__call(XML_val, Array)
SSViewer_DataPresenter.php:309
SilverStripe\View\SSViewer_DataPresenter->__call(XML_val, Array)
.cachevendor.silverstripe.admin.templates.SilverStripe.Admin.LeftAndMain.ss:41
include(/tmp/silverstripe-cache-php7.4.12-var-www/www-data/.cachevendor.silverstripe.admin.templates.SilverStripe.Admin.LeftAndMain.ss)
SSViewer.php:602
SilverStripe\View\SSViewer->includeGeneratedTemplate(/tmp/silverstripe-cache-php7.4.12-var-www/www-data/.cachevendor.silverstripe.admin.templates.SilverStripe.Admin.LeftAndMain.ss, SilverStripe\CMS\Controllers\CMSPageEditController, , Array, )
SSViewer.php:674
SilverStripe\View\SSViewer->process(SilverStripe\CMS\Controllers\CMSPageEditController, )
ViewableData.php:401
SilverStripe\View\ViewableData->renderWith(SilverStripe\View\SSViewer)
LeftAndMain.php:994
SilverStripe\Admin\LeftAndMain->SilverStripe\Admin\{closure}()
call_user_func(Closure)
PjaxResponseNegotiator.php:92
SilverStripe\Control\PjaxResponseNegotiator->respond(SilverStripe\Control\HTTPRequest)
LeftAndMain.php:968
SilverStripe\Admin\LeftAndMain->show(SilverStripe\Control\HTTPRequest)
RequestHandler.php:323
SilverStripe\Control\RequestHandler->handleAction(SilverStripe\Control\HTTPRequest, show)
Controller.php:286
SilverStripe\Control\Controller->handleAction(SilverStripe\Control\HTTPRequest, show)
RequestHandler.php:202
SilverStripe\Control\RequestHandler->handleRequest(SilverStripe\Control\HTTPRequest)
Controller.php:212
SilverStripe\Control\Controller->handleRequest(SilverStripe\Control\HTTPRequest)
LeftAndMain.php:766
SilverStripe\Admin\LeftAndMain->handleRequest(SilverStripe\Control\HTTPRequest)
AdminRootController.php:123
SilverStripe\Admin\AdminRootController->handleRequest(SilverStripe\Control\HTTPRequest)
Director.php:360
SilverStripe\Control\Director->SilverStripe\Control\{closure}(SilverStripe\Control\HTTPRequest)
DetectLocaleMiddleware.php:122
TractorCow\Fluent\Middleware\DetectLocaleMiddleware->TractorCow\Fluent\Middleware\{closure}(TractorCow\Fluent\State\FluentState)
FluentState.php:152
TractorCow\Fluent\State\FluentState->withState(Closure)
DetectLocaleMiddleware.php:123
TractorCow\Fluent\Middleware\DetectLocaleMiddleware->process(SilverStripe\Control\HTTPRequest, Closure)
HTTPMiddlewareAware.php:62
SilverStripe\Control\Director->SilverStripe\Control\Middleware\{closure}(SilverStripe\Control\HTTPRequest)
InitStateMiddleware.php:51
TractorCow\Fluent\Middleware\InitStateMiddleware->TractorCow\Fluent\Middleware\{closure}(TractorCow\Fluent\State\FluentState)
FluentState.php:152
TractorCow\Fluent\State\FluentState->withState(Closure)
InitStateMiddleware.php:52
TractorCow\Fluent\Middleware\InitStateMiddleware->process(SilverStripe\Control\HTTPRequest, Closure)
HTTPMiddlewareAware.php:62
SilverStripe\Control\Director->SilverStripe\Control\Middleware\{closure}(SilverStripe\Control\HTTPRequest)
SEORequestProcessor.php:81
SilverStripers\SEO\Control\SEORequestProcessor->process(SilverStripe\Control\HTTPRequest, Closure)
HTTPMiddlewareAware.php:62
SilverStripe\Control\Director->SilverStripe\Control\Middleware\{closure}(SilverStripe\Control\HTTPRequest)
VersionedHTTPMiddleware.php:41
SilverStripe\Versioned\VersionedHTTPMiddleware->process(SilverStripe\Control\HTTPRequest, Closure)
HTTPMiddlewareAware.php:62
SilverStripe\Control\Director->SilverStripe\Control\Middleware\{closure}(SilverStripe\Control\HTTPRequest)
ConfirmationMiddleware.php:254
SilverStripe\Control\Middleware\ConfirmationMiddleware->process(SilverStripe\Control\HTTPRequest, Closure)
HTTPMiddlewareAware.php:62
SilverStripe\Control\Director->SilverStripe\Control\Middleware\{closure}(SilverStripe\Control\HTTPRequest)
ConfirmationMiddleware.php:254
SilverStripe\Control\Middleware\ConfirmationMiddleware->process(SilverStripe\Control\HTTPRequest, Closure)
HTTPMiddlewareAware.php:62
SilverStripe\Control\Director->SilverStripe\Control\Middleware\{closure}(SilverStripe\Control\HTTPRequest)
PasswordExpirationMiddleware.php:84
SilverStripe\Security\PasswordExpirationMiddleware->process(SilverStripe\Control\HTTPRequest, Closure)
HTTPMiddlewareAware.php:62
SilverStripe\Control\Director->SilverStripe\Control\Middleware\{closure}(SilverStripe\Control\HTTPRequest)
BasicAuthMiddleware.php:68
SilverStripe\Security\BasicAuthMiddleware->process(SilverStripe\Control\HTTPRequest, Closure)
HTTPMiddlewareAware.php:62
SilverStripe\Control\Director->SilverStripe\Control\Middleware\{closure}(SilverStripe\Control\HTTPRequest)
AuthenticationMiddleware.php:61
SilverStripe\Security\AuthenticationMiddleware->process(SilverStripe\Control\HTTPRequest, Closure)
HTTPMiddlewareAware.php:62
SilverStripe\Control\Director->SilverStripe\Control\Middleware\{closure}(SilverStripe\Control\HTTPRequest)
ExecMetricMiddleware.php:20
SilverStripe\Control\Middleware\ExecMetricMiddleware->process(SilverStripe\Control\HTTPRequest, Closure)
HTTPMiddlewareAware.php:62
SilverStripe\Control\Director->SilverStripe\Control\Middleware\{closure}(SilverStripe\Control\HTTPRequest)
CanonicalURLMiddleware.php:190
SilverStripe\Control\Middleware\CanonicalURLMiddleware->process(SilverStripe\Control\HTTPRequest, Closure)
HTTPMiddlewareAware.php:62
SilverStripe\Control\Director->SilverStripe\Control\Middleware\{closure}(SilverStripe\Control\HTTPRequest)
HTTPCacheControlMiddleware.php:42
SilverStripe\Control\Middleware\HTTPCacheControlMiddleware->process(SilverStripe\Control\HTTPRequest, Closure)
HTTPMiddlewareAware.php:62
SilverStripe\Control\Director->SilverStripe\Control\Middleware\{closure}(SilverStripe\Control\HTTPRequest)
ChangeDetectionMiddleware.php:28
SilverStripe\Control\Middleware\ChangeDetectionMiddleware->process(SilverStripe\Control\HTTPRequest, Closure)
HTTPMiddlewareAware.php:62
SilverStripe\Control\Director->SilverStripe\Control\Middleware\{closure}(SilverStripe\Control\HTTPRequest)
FlushMiddleware.php:27
SilverStripe\Control\Middleware\FlushMiddleware->process(SilverStripe\Control\HTTPRequest, Closure)
HTTPMiddlewareAware.php:62
SilverStripe\Control\Director->SilverStripe\Control\Middleware\{closure}(SilverStripe\Control\HTTPRequest)
RequestProcessor.php:66
SilverStripe\Control\RequestProcessor->process(SilverStripe\Control\HTTPRequest, Closure)
HTTPMiddlewareAware.php:62
SilverStripe\Control\Director->SilverStripe\Control\Middleware\{closure}(SilverStripe\Control\HTTPRequest)
SessionMiddleware.php:20
SilverStripe\Control\Middleware\SessionMiddleware->process(SilverStripe\Control\HTTPRequest, Closure)
HTTPMiddlewareAware.php:62
SilverStripe\Control\Director->SilverStripe\Control\Middleware\{closure}(SilverStripe\Control\HTTPRequest)
AllowedHostsMiddleware.php:60
SilverStripe\Control\Middleware\AllowedHostsMiddleware->process(SilverStripe\Control\HTTPRequest, Closure)
HTTPMiddlewareAware.php:62
SilverStripe\Control\Director->SilverStripe\Control\Middleware\{closure}(SilverStripe\Control\HTTPRequest)
TrustedProxyMiddleware.php:176
SilverStripe\Control\Middleware\TrustedProxyMiddleware->process(SilverStripe\Control\HTTPRequest, Closure)
HTTPMiddlewareAware.php:62
SilverStripe\Control\Director->SilverStripe\Control\Middleware\{closure}(SilverStripe\Control\HTTPRequest)
HTTPMiddlewareAware.php:65
SilverStripe\Control\Director->callMiddleware(SilverStripe\Control\HTTPRequest, Closure)
Director.php:369
SilverStripe\Control\Director->handleRequest(SilverStripe\Control\HTTPRequest)
HTTPApplication.php:117
SilverStripe\Control\HTTPApplication::SilverStripe\Control\{closure}(SilverStripe\Control\HTTPRequest)
call_user_func(Closure, SilverStripe\Control\HTTPRequest)
HTTPApplication.php:136
SilverStripe\Control\HTTPApplication->SilverStripe\Control\{closure}(SilverStripe\Control\HTTPRequest)
HTTPMiddlewareAware.php:65
SilverStripe\Control\HTTPApplication->callMiddleware(SilverStripe\Control\HTTPRequest, Closure)
HTTPApplication.php:137
SilverStripe\Control\HTTPApplication->execute(SilverStripe\Control\HTTPRequest, Closure, )
HTTPApplication.php:116
SilverStripe\Control\HTTPApplication->handle(SilverStripe\Control\HTTPRequest)
index.php:24
[Notice] Trying to access array offset on value of type null
GET /admin/pages/edit/show/6
Line 261 in /var/www/vendor/undefinedoffset/sortablegridfield/src/Forms/GridFieldSortableRows.php

Source
252             $owner = $gridField->getForm()->getRecord();
253             $sortColumn = $this->sortColumn;
254             $i = 1;
255 
256             if ($many_many) {
257                 $schema=Injector::inst()->get(DataObjectSchema::class);
258                 $componentDetails=$schema->manyManyComponent(get_class($owner), (!empty($this->custom_relation_name) ? $this->custom_relation_name : $gridField->getName()));
259                 $parentField=$componentDetails['parentField'];
260                 $componentField=$componentDetails['childField'];
261                 $table=$componentDetails['join'];
262                 
263                 //For ManyManyThroughLists get the right join table
264                 if ($list instanceof ManyManyThroughList && class_exists($table)) {
265                     $table=$schema->tableName($table);
266                 }
267 
Trace
Monolog\ErrorHandler->handleError(8, Trying to access array offset on value of type null, /var/www/vendor/undefinedoffset/sortablegridfield/src/Forms/GridFieldSortableRows.php, 261, Array)
GridFieldSortableRows.php:261
UndefinedOffset\SortableGridField\Forms\GridFieldSortableRows->fixSortColumn(SilverStripe\Forms\GridField\GridField, SilverStripe\ORM\ManyManyList)
GridFieldSortableRows.php:154
UndefinedOffset\SortableGridField\Forms\GridFieldSortableRows->getManipulatedData(SilverStripe\Forms\GridField\GridField, SilverStripe\ORM\ManyManyList)
GridField.php:394
SilverStripe\Forms\GridField\GridField->getManipulatedList()
GridField.php:427
SilverStripe\Forms\GridField\GridField->FieldHolder()
call_user_func_array(Array, Array)
ViewableData.php:485
SilverStripe\View\ViewableData->obj(FieldHolder, , 1)
ViewableData.php:547
SilverStripe\View\ViewableData->XML_val(FieldHolder, , 1)
SSViewer_Scope.php:323
SilverStripe\View\SSViewer_Scope->__call(XML_val, Array)
SSViewer_DataPresenter.php:309
SilverStripe\View\SSViewer_DataPresenter->__call(XML_val, Array)
.cachevendor.silverstripe.admin.themes.cms-forms.templates.SilverStripe.Forms.TabSet.ss:75
include(/tmp/silverstripe-cache-php7.4.12-var-www/www-data/.cachevendor.silverstripe.admin.themes.cms-forms.templates.SilverStripe.Forms.TabSet.ss)
SSViewer.php:602
SilverStripe\View\SSViewer->includeGeneratedTemplate(/tmp/silverstripe-cache-php7.4.12-var-www/www-data/.cachevendor.silverstripe.admin.themes.cms-forms.templates.SilverStripe.Forms.TabSet.ss, SilverStripe\Forms\TabSet, , Array, )
SSViewer.php:674
SilverStripe\View\SSViewer->process(SilverStripe\Forms\TabSet, )
ViewableData.php:401
SilverStripe\View\ViewableData->renderWith(SilverStripe\View\SSViewer)
TabSet.php:136
SilverStripe\Forms\TabSet->FieldHolder()
call_user_func_array(Array, Array)
ViewableData.php:485
SilverStripe\View\ViewableData->obj(FieldHolder, , 1)
ViewableData.php:547
SilverStripe\View\ViewableData->XML_val(FieldHolder, , 1)
SSViewer_Scope.php:323
SilverStripe\View\SSViewer_Scope->__call(XML_val, Array)
SSViewer_DataPresenter.php:309
SilverStripe\View\SSViewer_DataPresenter->__call(XML_val, Array)
.cachevendor.silverstripe.cms.templates.SilverStripe.CMS.Controllers.Includes.CMSMain_EditForm.ss:58
include(/tmp/silverstripe-cache-php7.4.12-var-www/www-data/.cachevendor.silverstripe.cms.templates.SilverStripe.CMS.Controllers.Includes.CMSMain_EditForm.ss)
SSViewer.php:602
SilverStripe\View\SSViewer->includeGeneratedTemplate(/tmp/silverstripe-cache-php7.4.12-var-www/www-data/.cachevendor.silverstripe.cms.templates.SilverStripe.CMS.Controllers.Includes.CMSMain_EditForm.ss, SilverStripe\Forms\Form, , Array, )
SSViewer.php:674
SilverStripe\View\SSViewer->process(SilverStripe\Forms\Form, )
ViewableData.php:401
SilverStripe\View\ViewableData->renderWith(SilverStripe\View\SSViewer)
Form.php:1603
SilverStripe\Forms\Form->forTemplate()
ViewableData.php:549
SilverStripe\View\ViewableData->XML_val(EditForm, , 1)
SSViewer_Scope.php:323
SilverStripe\View\SSViewer_Scope->__call(XML_val, Array)
SSViewer_DataPresenter.php:309
SilverStripe\View\SSViewer_DataPresenter->__call(XML_val, Array)
.cachevendor.silverstripe.cms.templates.SilverStripe.CMS.Controllers.Includes.CMSMain_Content.ss:97
include(/tmp/silverstripe-cache-php7.4.12-var-www/www-data/.cachevendor.silverstripe.cms.templates.SilverStripe.CMS.Controllers.Includes.CMSMain_Content.ss)
SSViewer.php:602
SilverStripe\View\SSViewer->includeGeneratedTemplate(/tmp/silverstripe-cache-php7.4.12-var-www/www-data/.cachevendor.silverstripe.cms.templates.SilverStripe.CMS.Controllers.Includes.CMSMain_Content.ss, SilverStripe\CMS\Controllers\CMSPageEditController, , Array, )
SSViewer.php:674
SilverStripe\View\SSViewer->process(SilverStripe\CMS\Controllers\CMSPageEditController, )
ViewableData.php:401
SilverStripe\View\ViewableData->renderWith(SilverStripe\View\SSViewer)
LeftAndMain.php:1138
SilverStripe\Admin\LeftAndMain->Content()
call_user_func_array(Array, Array)
ViewableData.php:485
SilverStripe\View\ViewableData->obj(Content, , 1)
ViewableData.php:547
SilverStripe\View\ViewableData->XML_val(Content, , 1)
SSViewer_Scope.php:323
SilverStripe\View\SSViewer_Scope->__call(XML_val, Array)
SSViewer_DataPresenter.php:309
SilverStripe\View\SSViewer_DataPresenter->__call(XML_val, Array)
.cachevendor.silverstripe.admin.templates.SilverStripe.Admin.LeftAndMain.ss:41
include(/tmp/silverstripe-cache-php7.4.12-var-www/www-data/.cachevendor.silverstripe.admin.templates.SilverStripe.Admin.LeftAndMain.ss)
SSViewer.php:602
SilverStripe\View\SSViewer->includeGeneratedTemplate(/tmp/silverstripe-cache-php7.4.12-var-www/www-data/.cachevendor.silverstripe.admin.templates.SilverStripe.Admin.LeftAndMain.ss, SilverStripe\CMS\Controllers\CMSPageEditController, , Array, )
SSViewer.php:674
SilverStripe\View\SSViewer->process(SilverStripe\CMS\Controllers\CMSPageEditController, )
ViewableData.php:401
SilverStripe\View\ViewableData->renderWith(SilverStripe\View\SSViewer)
LeftAndMain.php:994
SilverStripe\Admin\LeftAndMain->SilverStripe\Admin\{closure}()
call_user_func(Closure)
PjaxResponseNegotiator.php:92
SilverStripe\Control\PjaxResponseNegotiator->respond(SilverStripe\Control\HTTPRequest)
LeftAndMain.php:968
SilverStripe\Admin\LeftAndMain->show(SilverStripe\Control\HTTPRequest)
RequestHandler.php:323
SilverStripe\Control\RequestHandler->handleAction(SilverStripe\Control\HTTPRequest, show)
Controller.php:286
SilverStripe\Control\Controller->handleAction(SilverStripe\Control\HTTPRequest, show)
RequestHandler.php:202
SilverStripe\Control\RequestHandler->handleRequest(SilverStripe\Control\HTTPRequest)
Controller.php:212
SilverStripe\Control\Controller->handleRequest(SilverStripe\Control\HTTPRequest)
LeftAndMain.php:766
SilverStripe\Admin\LeftAndMain->handleRequest(SilverStripe\Control\HTTPRequest)
AdminRootController.php:123
SilverStripe\Admin\AdminRootController->handleRequest(SilverStripe\Control\HTTPRequest)
Director.php:360
SilverStripe\Control\Director->SilverStripe\Control\{closure}(SilverStripe\Control\HTTPRequest)
DetectLocaleMiddleware.php:122
TractorCow\Fluent\Middleware\DetectLocaleMiddleware->TractorCow\Fluent\Middleware\{closure}(TractorCow\Fluent\State\FluentState)
FluentState.php:152
TractorCow\Fluent\State\FluentState->withState(Closure)
DetectLocaleMiddleware.php:123
TractorCow\Fluent\Middleware\DetectLocaleMiddleware->process(SilverStripe\Control\HTTPRequest, Closure)
HTTPMiddlewareAware.php:62
SilverStripe\Control\Director->SilverStripe\Control\Middleware\{closure}(SilverStripe\Control\HTTPRequest)
InitStateMiddleware.php:51
TractorCow\Fluent\Middleware\InitStateMiddleware->TractorCow\Fluent\Middleware\{closure}(TractorCow\Fluent\State\FluentState)
FluentState.php:152
TractorCow\Fluent\State\FluentState->withState(Closure)
InitStateMiddleware.php:52
TractorCow\Fluent\Middleware\InitStateMiddleware->process(SilverStripe\Control\HTTPRequest, Closure)
HTTPMiddlewareAware.php:62
SilverStripe\Control\Director->SilverStripe\Control\Middleware\{closure}(SilverStripe\Control\HTTPRequest)
SEORequestProcessor.php:81
SilverStripers\SEO\Control\SEORequestProcessor->process(SilverStripe\Control\HTTPRequest, Closure)
HTTPMiddlewareAware.php:62
SilverStripe\Control\Director->SilverStripe\Control\Middleware\{closure}(SilverStripe\Control\HTTPRequest)
VersionedHTTPMiddleware.php:41
SilverStripe\Versioned\VersionedHTTPMiddleware->process(SilverStripe\Control\HTTPRequest, Closure)
HTTPMiddlewareAware.php:62
SilverStripe\Control\Director->SilverStripe\Control\Middleware\{closure}(SilverStripe\Control\HTTPRequest)
ConfirmationMiddleware.php:254
SilverStripe\Control\Middleware\ConfirmationMiddleware->process(SilverStripe\Control\HTTPRequest, Closure)
HTTPMiddlewareAware.php:62
SilverStripe\Control\Director->SilverStripe\Control\Middleware\{closure}(SilverStripe\Control\HTTPRequest)
ConfirmationMiddleware.php:254
SilverStripe\Control\Middleware\ConfirmationMiddleware->process(SilverStripe\Control\HTTPRequest, Closure)
HTTPMiddlewareAware.php:62
SilverStripe\Control\Director->SilverStripe\Control\Middleware\{closure}(SilverStripe\Control\HTTPRequest)
PasswordExpirationMiddleware.php:84
SilverStripe\Security\PasswordExpirationMiddleware->process(SilverStripe\Control\HTTPRequest, Closure)
HTTPMiddlewareAware.php:62
SilverStripe\Control\Director->SilverStripe\Control\Middleware\{closure}(SilverStripe\Control\HTTPRequest)
BasicAuthMiddleware.php:68
SilverStripe\Security\BasicAuthMiddleware->process(SilverStripe\Control\HTTPRequest, Closure)
HTTPMiddlewareAware.php:62
SilverStripe\Control\Director->SilverStripe\Control\Middleware\{closure}(SilverStripe\Control\HTTPRequest)
AuthenticationMiddleware.php:61
SilverStripe\Security\AuthenticationMiddleware->process(SilverStripe\Control\HTTPRequest, Closure)
HTTPMiddlewareAware.php:62
SilverStripe\Control\Director->SilverStripe\Control\Middleware\{closure}(SilverStripe\Control\HTTPRequest)
ExecMetricMiddleware.php:20
SilverStripe\Control\Middleware\ExecMetricMiddleware->process(SilverStripe\Control\HTTPRequest, Closure)
HTTPMiddlewareAware.php:62
SilverStripe\Control\Director->SilverStripe\Control\Middleware\{closure}(SilverStripe\Control\HTTPRequest)
CanonicalURLMiddleware.php:190
SilverStripe\Control\Middleware\CanonicalURLMiddleware->process(SilverStripe\Control\HTTPRequest, Closure)
HTTPMiddlewareAware.php:62
SilverStripe\Control\Director->SilverStripe\Control\Middleware\{closure}(SilverStripe\Control\HTTPRequest)
HTTPCacheControlMiddleware.php:42
SilverStripe\Control\Middleware\HTTPCacheControlMiddleware->process(SilverStripe\Control\HTTPRequest, Closure)
HTTPMiddlewareAware.php:62
SilverStripe\Control\Director->SilverStripe\Control\Middleware\{closure}(SilverStripe\Control\HTTPRequest)
ChangeDetectionMiddleware.php:28
SilverStripe\Control\Middleware\ChangeDetectionMiddleware->process(SilverStripe\Control\HTTPRequest, Closure)
HTTPMiddlewareAware.php:62
SilverStripe\Control\Director->SilverStripe\Control\Middleware\{closure}(SilverStripe\Control\HTTPRequest)
FlushMiddleware.php:27
SilverStripe\Control\Middleware\FlushMiddleware->process(SilverStripe\Control\HTTPRequest, Closure)
HTTPMiddlewareAware.php:62
SilverStripe\Control\Director->SilverStripe\Control\Middleware\{closure}(SilverStripe\Control\HTTPRequest)
RequestProcessor.php:66
SilverStripe\Control\RequestProcessor->process(SilverStripe\Control\HTTPRequest, Closure)
HTTPMiddlewareAware.php:62
SilverStripe\Control\Director->SilverStripe\Control\Middleware\{closure}(SilverStripe\Control\HTTPRequest)
SessionMiddleware.php:20
SilverStripe\Control\Middleware\SessionMiddleware->process(SilverStripe\Control\HTTPRequest, Closure)
HTTPMiddlewareAware.php:62
SilverStripe\Control\Director->SilverStripe\Control\Middleware\{closure}(SilverStripe\Control\HTTPRequest)
AllowedHostsMiddleware.php:60
SilverStripe\Control\Middleware\AllowedHostsMiddleware->process(SilverStripe\Control\HTTPRequest, Closure)
HTTPMiddlewareAware.php:62
SilverStripe\Control\Director->SilverStripe\Control\Middleware\{closure}(SilverStripe\Control\HTTPRequest)
TrustedProxyMiddleware.php:176
SilverStripe\Control\Middleware\TrustedProxyMiddleware->process(SilverStripe\Control\HTTPRequest, Closure)
HTTPMiddlewareAware.php:62
SilverStripe\Control\Director->SilverStripe\Control\Middleware\{closure}(SilverStripe\Control\HTTPRequest)
HTTPMiddlewareAware.php:65
SilverStripe\Control\Director->callMiddleware(SilverStripe\Control\HTTPRequest, Closure)
Director.php:369
SilverStripe\Control\Director->handleRequest(SilverStripe\Control\HTTPRequest)
HTTPApplication.php:117
SilverStripe\Control\HTTPApplication::SilverStripe\Control\{closure}(SilverStripe\Control\HTTPRequest)
call_user_func(Closure, SilverStripe\Control\HTTPRequest)
HTTPApplication.php:136
SilverStripe\Control\HTTPApplication->SilverStripe\Control\{closure}(SilverStripe\Control\HTTPRequest)
HTTPMiddlewareAware.php:65
SilverStripe\Control\HTTPApplication->callMiddleware(SilverStripe\Control\HTTPRequest, Closure)
HTTPApplication.php:137
SilverStripe\Control\HTTPApplication->execute(SilverStripe\Control\HTTPRequest, Closure, )
HTTPApplication.php:116
SilverStripe\Control\HTTPApplication->handle(SilverStripe\Control\HTTPRequest)
index.php:24
[Emergency] Uncaught SilverStripe\ORM\Connect\DatabaseException: Couldn't run query: UPDATE "" SET "SortOrder" = 1 WHERE "" = 1 AND "" = 6 Incorrect table name ''
GET /admin/pages/edit/show/6
Line 64 in /var/www/vendor/silverstripe/framework/src/ORM/Connect/DBConnector.php

Source
55         if (!empty($sql)) {
56             $formatter = new SQLFormatter();
57             $formattedSQL = $formatter->formatPlain($sql);
58             $msg = "Couldn't run query:\n\n{$formattedSQL}\n\n{$msg}";
59         }
60 
61         if ($errorLevel === E_USER_ERROR) {
62             // Treating errors as exceptions better allows for responding to errors
63             // in code, such as credential checking during installation
64             throw new DatabaseException($msg, 0, null, $sql, $parameters);
65         } else {
66             user_error($msg, $errorLevel);
67         }
68     }
69 
70     /**
Trace
SilverStripe\ORM\Connect\DBConnector->databaseError(Couldn't run query: UPDATE "" SET "SortOrder" = 1 WHERE "" = 1 AND "" = 6 Incorrect table name '', 256, UPDATE "" SET "SortOrder" = 1 WHERE "" = 1 AND "" = 6)
MySQLiConnector.php:181
SilverStripe\ORM\Connect\MySQLiConnector->query(UPDATE "" SET "SortOrder" = 1 WHERE "" = 1 AND "" = 6, 256)
Database.php:159
SilverStripe\ORM\Connect\Database->SilverStripe\ORM\Connect\{closure}(UPDATE "" SET "SortOrder" = 1 WHERE "" = 1 AND "" = 6)
Database.php:258
SilverStripe\ORM\Connect\Database->benchmarkQuery(UPDATE "" SET "SortOrder" = 1 WHERE "" = 1 AND "" = 6, Closure)
Database.php:160
SilverStripe\ORM\Connect\Database->query(UPDATE "" SET "SortOrder" = 1 WHERE "" = 1 AND "" = 6, 256)
MySQLDatabase.php:396
SilverStripe\ORM\Connect\MySQLDatabase->query(UPDATE "" SET "SortOrder" = 1 WHERE "" = 1 AND "" = 6, 256)
DB.php:353
SilverStripe\ORM\DB::query(UPDATE "" SET "SortOrder" = 1 WHERE "" = 1 AND "" = 6)
GridFieldSortableRows.php:332
UndefinedOffset\SortableGridField\Forms\GridFieldSortableRows->fixSortColumn(SilverStripe\Forms\GridField\GridField, SilverStripe\ORM\ManyManyList)
GridFieldSortableRows.php:154
UndefinedOffset\SortableGridField\Forms\GridFieldSortableRows->getManipulatedData(SilverStripe\Forms\GridField\GridField, SilverStripe\ORM\ManyManyList)
GridField.php:394
SilverStripe\Forms\GridField\GridField->getManipulatedList()
GridField.php:427
SilverStripe\Forms\GridField\GridField->FieldHolder()
call_user_func_array(Array, Array)
ViewableData.php:485
SilverStripe\View\ViewableData->obj(FieldHolder, , 1)
ViewableData.php:547
SilverStripe\View\ViewableData->XML_val(FieldHolder, , 1)
SSViewer_Scope.php:323
SilverStripe\View\SSViewer_Scope->__call(XML_val, Array)
SSViewer_DataPresenter.php:309
SilverStripe\View\SSViewer_DataPresenter->__call(XML_val, Array)
.cachevendor.silverstripe.admin.themes.cms-forms.templates.SilverStripe.Forms.TabSet.ss:75
include(/tmp/silverstripe-cache-php7.4.12-var-www/www-data/.cachevendor.silverstripe.admin.themes.cms-forms.templates.SilverStripe.Forms.TabSet.ss)
SSViewer.php:602
SilverStripe\View\SSViewer->includeGeneratedTemplate(/tmp/silverstripe-cache-php7.4.12-var-www/www-data/.cachevendor.silverstripe.admin.themes.cms-forms.templates.SilverStripe.Forms.TabSet.ss, SilverStripe\Forms\TabSet, , Array, )
SSViewer.php:674
SilverStripe\View\SSViewer->process(SilverStripe\Forms\TabSet, )
ViewableData.php:401
SilverStripe\View\ViewableData->renderWith(SilverStripe\View\SSViewer)
TabSet.php:136
SilverStripe\Forms\TabSet->FieldHolder()
call_user_func_array(Array, Array)
ViewableData.php:485
SilverStripe\View\ViewableData->obj(FieldHolder, , 1)
ViewableData.php:547
SilverStripe\View\ViewableData->XML_val(FieldHolder, , 1)
SSViewer_Scope.php:323
SilverStripe\View\SSViewer_Scope->__call(XML_val, Array)
SSViewer_DataPresenter.php:309
SilverStripe\View\SSViewer_DataPresenter->__call(XML_val, Array)
.cachevendor.silverstripe.cms.templates.SilverStripe.CMS.Controllers.Includes.CMSMain_EditForm.ss:58
include(/tmp/silverstripe-cache-php7.4.12-var-www/www-data/.cachevendor.silverstripe.cms.templates.SilverStripe.CMS.Controllers.Includes.CMSMain_EditForm.ss)
SSViewer.php:602
SilverStripe\View\SSViewer->includeGeneratedTemplate(/tmp/silverstripe-cache-php7.4.12-var-www/www-data/.cachevendor.silverstripe.cms.templates.SilverStripe.CMS.Controllers.Includes.CMSMain_EditForm.ss, SilverStripe\Forms\Form, , Array, )
SSViewer.php:674
SilverStripe\View\SSViewer->process(SilverStripe\Forms\Form, )
ViewableData.php:401
SilverStripe\View\ViewableData->renderWith(SilverStripe\View\SSViewer)
Form.php:1603
SilverStripe\Forms\Form->forTemplate()
ViewableData.php:549
SilverStripe\View\ViewableData->XML_val(EditForm, , 1)
SSViewer_Scope.php:323
SilverStripe\View\SSViewer_Scope->__call(XML_val, Array)
SSViewer_DataPresenter.php:309
SilverStripe\View\SSViewer_DataPresenter->__call(XML_val, Array)
.cachevendor.silverstripe.cms.templates.SilverStripe.CMS.Controllers.Includes.CMSMain_Content.ss:97
include(/tmp/silverstripe-cache-php7.4.12-var-www/www-data/.cachevendor.silverstripe.cms.templates.SilverStripe.CMS.Controllers.Includes.CMSMain_Content.ss)
SSViewer.php:602
SilverStripe\View\SSViewer->includeGeneratedTemplate(/tmp/silverstripe-cache-php7.4.12-var-www/www-data/.cachevendor.silverstripe.cms.templates.SilverStripe.CMS.Controllers.Includes.CMSMain_Content.ss, SilverStripe\CMS\Controllers\CMSPageEditController, , Array, )
SSViewer.php:674
SilverStripe\View\SSViewer->process(SilverStripe\CMS\Controllers\CMSPageEditController, )
ViewableData.php:401
SilverStripe\View\ViewableData->renderWith(SilverStripe\View\SSViewer)
LeftAndMain.php:1138
SilverStripe\Admin\LeftAndMain->Content()
call_user_func_array(Array, Array)
ViewableData.php:485
SilverStripe\View\ViewableData->obj(Content, , 1)
ViewableData.php:547
SilverStripe\View\ViewableData->XML_val(Content, , 1)
SSViewer_Scope.php:323
SilverStripe\View\SSViewer_Scope->__call(XML_val, Array)
SSViewer_DataPresenter.php:309
SilverStripe\View\SSViewer_DataPresenter->__call(XML_val, Array)
.cachevendor.silverstripe.admin.templates.SilverStripe.Admin.LeftAndMain.ss:41
include(/tmp/silverstripe-cache-php7.4.12-var-www/www-data/.cachevendor.silverstripe.admin.templates.SilverStripe.Admin.LeftAndMain.ss)
SSViewer.php:602
SilverStripe\View\SSViewer->includeGeneratedTemplate(/tmp/silverstripe-cache-php7.4.12-var-www/www-data/.cachevendor.silverstripe.admin.templates.SilverStripe.Admin.LeftAndMain.ss, SilverStripe\CMS\Controllers\CMSPageEditController, , Array, )
SSViewer.php:674
SilverStripe\View\SSViewer->process(SilverStripe\CMS\Controllers\CMSPageEditController, )
ViewableData.php:401
SilverStripe\View\ViewableData->renderWith(SilverStripe\View\SSViewer)
LeftAndMain.php:994
SilverStripe\Admin\LeftAndMain->SilverStripe\Admin\{closure}()
call_user_func(Closure)
PjaxResponseNegotiator.php:92
SilverStripe\Control\PjaxResponseNegotiator->respond(SilverStripe\Control\HTTPRequest)
LeftAndMain.php:968
SilverStripe\Admin\LeftAndMain->show(SilverStripe\Control\HTTPRequest)
RequestHandler.php:323
SilverStripe\Control\RequestHandler->handleAction(SilverStripe\Control\HTTPRequest, show)
Controller.php:286
SilverStripe\Control\Controller->handleAction(SilverStripe\Control\HTTPRequest, show)
RequestHandler.php:202
SilverStripe\Control\RequestHandler->handleRequest(SilverStripe\Control\HTTPRequest)
Controller.php:212
SilverStripe\Control\Controller->handleRequest(SilverStripe\Control\HTTPRequest)
LeftAndMain.php:766
SilverStripe\Admin\LeftAndMain->handleRequest(SilverStripe\Control\HTTPRequest)
AdminRootController.php:123
SilverStripe\Admin\AdminRootController->handleRequest(SilverStripe\Control\HTTPRequest)
Director.php:360
SilverStripe\Control\Director->SilverStripe\Control\{closure}(SilverStripe\Control\HTTPRequest)
DetectLocaleMiddleware.php:122
TractorCow\Fluent\Middleware\DetectLocaleMiddleware->TractorCow\Fluent\Middleware\{closure}(TractorCow\Fluent\State\FluentState)
FluentState.php:152
TractorCow\Fluent\State\FluentState->withState(Closure)
DetectLocaleMiddleware.php:123
TractorCow\Fluent\Middleware\DetectLocaleMiddleware->process(SilverStripe\Control\HTTPRequest, Closure)
HTTPMiddlewareAware.php:62
SilverStripe\Control\Director->SilverStripe\Control\Middleware\{closure}(SilverStripe\Control\HTTPRequest)
InitStateMiddleware.php:51
TractorCow\Fluent\Middleware\InitStateMiddleware->TractorCow\Fluent\Middleware\{closure}(TractorCow\Fluent\State\FluentState)
FluentState.php:152
TractorCow\Fluent\State\FluentState->withState(Closure)
InitStateMiddleware.php:52
TractorCow\Fluent\Middleware\InitStateMiddleware->process(SilverStripe\Control\HTTPRequest, Closure)
HTTPMiddlewareAware.php:62
SilverStripe\Control\Director->SilverStripe\Control\Middleware\{closure}(SilverStripe\Control\HTTPRequest)
SEORequestProcessor.php:81
SilverStripers\SEO\Control\SEORequestProcessor->process(SilverStripe\Control\HTTPRequest, Closure)
HTTPMiddlewareAware.php:62
SilverStripe\Control\Director->SilverStripe\Control\Middleware\{closure}(SilverStripe\Control\HTTPRequest)
VersionedHTTPMiddleware.php:41
SilverStripe\Versioned\VersionedHTTPMiddleware->process(SilverStripe\Control\HTTPRequest, Closure)
HTTPMiddlewareAware.php:62
SilverStripe\Control\Director->SilverStripe\Control\Middleware\{closure}(SilverStripe\Control\HTTPRequest)
ConfirmationMiddleware.php:254
SilverStripe\Control\Middleware\ConfirmationMiddleware->process(SilverStripe\Control\HTTPRequest, Closure)
HTTPMiddlewareAware.php:62
SilverStripe\Control\Director->SilverStripe\Control\Middleware\{closure}(SilverStripe\Control\HTTPRequest)
ConfirmationMiddleware.php:254
SilverStripe\Control\Middleware\ConfirmationMiddleware->process(SilverStripe\Control\HTTPRequest, Closure)
HTTPMiddlewareAware.php:62
SilverStripe\Control\Director->SilverStripe\Control\Middleware\{closure}(SilverStripe\Control\HTTPRequest)
PasswordExpirationMiddleware.php:84
SilverStripe\Security\PasswordExpirationMiddleware->process(SilverStripe\Control\HTTPRequest, Closure)
HTTPMiddlewareAware.php:62
SilverStripe\Control\Director->SilverStripe\Control\Middleware\{closure}(SilverStripe\Control\HTTPRequest)
BasicAuthMiddleware.php:68
SilverStripe\Security\BasicAuthMiddleware->process(SilverStripe\Control\HTTPRequest, Closure)
HTTPMiddlewareAware.php:62
SilverStripe\Control\Director->SilverStripe\Control\Middleware\{closure}(SilverStripe\Control\HTTPRequest)
AuthenticationMiddleware.php:61
SilverStripe\Security\AuthenticationMiddleware->process(SilverStripe\Control\HTTPRequest, Closure)
HTTPMiddlewareAware.php:62
SilverStripe\Control\Director->SilverStripe\Control\Middleware\{closure}(SilverStripe\Control\HTTPRequest)
ExecMetricMiddleware.php:20
SilverStripe\Control\Middleware\ExecMetricMiddleware->process(SilverStripe\Control\HTTPRequest, Closure)
HTTPMiddlewareAware.php:62
SilverStripe\Control\Director->SilverStripe\Control\Middleware\{closure}(SilverStripe\Control\HTTPRequest)
CanonicalURLMiddleware.php:190
SilverStripe\Control\Middleware\CanonicalURLMiddleware->process(SilverStripe\Control\HTTPRequest, Closure)
HTTPMiddlewareAware.php:62
SilverStripe\Control\Director->SilverStripe\Control\Middleware\{closure}(SilverStripe\Control\HTTPRequest)
HTTPCacheControlMiddleware.php:42
SilverStripe\Control\Middleware\HTTPCacheControlMiddleware->process(SilverStripe\Control\HTTPRequest, Closure)
HTTPMiddlewareAware.php:62
SilverStripe\Control\Director->SilverStripe\Control\Middleware\{closure}(SilverStripe\Control\HTTPRequest)
ChangeDetectionMiddleware.php:28
SilverStripe\Control\Middleware\ChangeDetectionMiddleware->process(SilverStripe\Control\HTTPRequest, Closure)
HTTPMiddlewareAware.php:62
SilverStripe\Control\Director->SilverStripe\Control\Middleware\{closure}(SilverStripe\Control\HTTPRequest)
FlushMiddleware.php:27
SilverStripe\Control\Middleware\FlushMiddleware->process(SilverStripe\Control\HTTPRequest, Closure)
HTTPMiddlewareAware.php:62
SilverStripe\Control\Director->SilverStripe\Control\Middleware\{closure}(SilverStripe\Control\HTTPRequest)
RequestProcessor.php:66
SilverStripe\Control\RequestProcessor->process(SilverStripe\Control\HTTPRequest, Closure)
HTTPMiddlewareAware.php:62
SilverStripe\Control\Director->SilverStripe\Control\Middleware\{closure}(SilverStripe\Control\HTTPRequest)
SessionMiddleware.php:20
SilverStripe\Control\Middleware\SessionMiddleware->process(SilverStripe\Control\HTTPRequest, Closure)
HTTPMiddlewareAware.php:62
SilverStripe\Control\Director->SilverStripe\Control\Middleware\{closure}(SilverStripe\Control\HTTPRequest)
AllowedHostsMiddleware.php:60
SilverStripe\Control\Middleware\AllowedHostsMiddleware->process(SilverStripe\Control\HTTPRequest, Closure)
HTTPMiddlewareAware.php:62
SilverStripe\Control\Director->SilverStripe\Control\Middleware\{closure}(SilverStripe\Control\HTTPRequest)
TrustedProxyMiddleware.php:176
SilverStripe\Control\Middleware\TrustedProxyMiddleware->process(SilverStripe\Control\HTTPRequest, Closure)
HTTPMiddlewareAware.php:62
SilverStripe\Control\Director->SilverStripe\Control\Middleware\{closure}(SilverStripe\Control\HTTPRequest)
HTTPMiddlewareAware.php:65
SilverStripe\Control\Director->callMiddleware(SilverStripe\Control\HTTPRequest, Closure)
Director.php:369
SilverStripe\Control\Director->handleRequest(SilverStripe\Control\HTTPRequest)
HTTPApplication.php:117
SilverStripe\Control\HTTPApplication::SilverStripe\Control\{closure}(SilverStripe\Control\HTTPRequest)
call_user_func(Closure, SilverStripe\Control\HTTPRequest)
HTTPApplication.php:136
SilverStripe\Control\HTTPApplication->SilverStripe\Control\{closure}(SilverStripe\Control\HTTPRequest)
HTTPMiddlewareAware.php:65
SilverStripe\Control\HTTPApplication->callMiddleware(SilverStripe\Control\HTTPRequest, Closure)
HTTPApplication.php:137
SilverStripe\Control\HTTPApplication->execute(SilverStripe\Control\HTTPRequest, Closure, )
HTTPApplication.php:116
SilverStripe\Control\HTTPApplication->handle(SilverStripe\Control\HTTPRequest)
index.php:24
UndefinedOffset commented 3 years ago

I believe the issue you are running into is caused by the name of the grid field, try setting it to match the name of the relationship so:

$gridfield = new GridField("PEntrys", "PEntrys", $this->PEntrys(), $gridFieldConfig);

Alternatively you can use the setCustomRelationName method on GridFieldSortableRows to set the relationship name.

Let me know if that helps 😄

webspilka commented 3 years ago

cool, it worked :sunglasses: