Deleting Group 1.8 alpha3

Hello all,

when we try to delete a display group or unassign a display group from a display we get the same error

Page:
POST /display/:id/displaygroup/assign
DELETE /displaygroup/:id

Cannot load without first calling setChildObjectDependencies#0 /var/www/lib/Entity/DisplayGroup.php(458): Xibo\Entity\DisplayGroup->load() #1 /var/www/lib/Controller/DisplayGroup.php(568): Xibo\Entity\DisplayGroup->delete() #2 [internal function]: Xibo\Controller\DisplayGroup->delete(‘10’) #3 /var/www/vendor/akrabat/rka-slim-controller/RKA/Slim.php(79): call_user_func_array(Array, Array) #4 [internal function]: RKA\Slim->RKA{closure}(‘10’) #5 /var/www/vendor/slim/slim/Slim/Route.php(468): call_user_func_array(Object(Closure), Array) #6 /var/www/vendor/slim/slim/Slim/Slim.php(1357): Slim\Route->dispatch() #7 /var/www/vendor/slim/slim/Slim/Middleware/Flash.php(85): Slim\Slim->call() #8 /var/www/vendor/slim/slim/Slim/Middleware/MethodOverride.php(92): Slim\Middleware\Flash->call() #9 /var/www/lib/Middleware/Actions.php(96): Slim\Middleware\MethodOverride->call() #10 /var/www/lib/Middleware/Theme.php(73): Xibo\Middleware\Actions->call() #11 /var/www/lib/Middleware/WebAuthentication.php(130): Xibo\Middleware\Theme->call() #12 /var/www/lib/Middleware/CsrfGuard.php(62): Xibo\Middleware\WebAuthentication->call() #13 /var/www/lib/Middleware/State.php(103): Xibo\Middleware\CsrfGuard->call() #14 /var/www/lib/Middleware/Storage.php(46): Xibo\Middleware\State->call() #15 /var/www/lib/Middleware/Xmr.php(38): Xibo\Middleware\Storage->call() #16 /var/www/vendor/slim/slim/Slim/Slim.php(1302): Xibo\Middleware\Xmr->call() #17 /var/www/web/index.php(120): Slim\Slim->run() #18 {main}

Yup, that would be correct it is a bug:

I’ll add info about deleting existing groups there as well, thank you for bringing this to our attention

The bug was fixed with the following change in file Lib\Controller\DisplayGroup.php

Change

function delete($displayGroupId)
{
    $displayGroup = $this->displayGroupFactory->getById($displayGroupId);

    if (!$this->getUser()->checkDeleteable($displayGroup))
        throw new AccessDeniedException();

To

function delete($displayGroupId)
{
    $displayGroup = $this->displayGroupFactory->getById($displayGroupId);
    $displayGroup->setChildObjectDependencies($this->displayFactory, $this->layoutFactory, $this->mediaFactory, $this->scheduleFactory);

    if (!$this->getUser()->checkDeleteable($displayGroup))
        throw new AccessDeniedException();
1 Like