Grav: Plugin error after upgrading plugins

Created on 10 Feb 2020  路  9Comments  路  Source: getgrav/grav

Can't access admin at all because of this.

It says,

RuntimeException
Grav\Framework\Acl\Permissions::getParent(): Adding child action before parent is not supported

The code where the error is thrown is:

    protected function getParent(string $name): ?Action
    {
        if ($pos = strrpos($name, '.')) {
            $name = substr($name, 0, $pos);

            $parent = $this->getAction($name);
            if (!$parent) {
                // TODO: create parent action(s) on the fly
                throw new \RuntimeException(__METHOD__ . '(): Adding child action before parent is not supported');
            }

            return $parent;
        }

        return null;
    }

This seems to be triggered on

Grav\Plugin\FlexObjectsPlugin onAdminRegisterPermissions
Grav\Plugin\Admin\Admin addPermissions
Grav\Framework\Acl\Permissions addAction

and finally

Grav\Framework\Acl\Permissions getParent

Is there anything I can do to fix this?

1.7 bug duplicate fixed in repo

Most helpful comment

@jeifour Delete vendor and copy it over from the new release.

I'm going to close this issue soon as working version is now out.

All 9 comments

I'ts already fixed for the next RC.

I am happy to hear that, but, can you please guide me on how to fix this manually (for example, by editing source code)? I can't access the admin to update plugins, and I don't have access to GPM on my server.

I think that this one can be fixed by just composer update.

Please see:
https://github.com/getgrav/grav/issues/2811

Is there a way to fix this without shell access to the server? Right now the Admin panel stopped working and I can only modify files through FTP access.

@jeifour Yes, that's my problem too.

In the worst case, we may need to copy our entire site to local, run composer update on that local copy, and then replace the remote files entirely with the updated local copy. But if that's avoidable, then that'd be better :)

@jeifour Delete vendor and copy it over from the new release.

I'm going to close this issue soon as working version is now out.

Replaced the vendor folder but the same error appears. Since the error appears on a file inside the system folder, I tried to replace the system folder too. While this fixed the admin page, I can't access the pages list on the admin, which shows the error:

An exception has been thrown during the rendering of a template ("Flex Directory not defined, object is not fully defined").

This is from the file called user/plugins/flex-objects/admin/templates/flex-objects/types/default/list.html.twig and occurs on line 36

{% set collection = directory ? collection.isAuthorized('list') %}

Is there another way to fix this?

Thanks.

Make sure that flex objects plugin matches the RC of both Grav and admin. For RC I'm not supporting mismatch on versions as this is still under development.

I have been able to fix our Grav installation with the help provided in the previous comments, so this can probably be closed.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ghtmtt picture ghtmtt  路  3Comments

RyanMPierson picture RyanMPierson  路  3Comments

bmrankin picture bmrankin  路  3Comments

fvsch picture fvsch  路  3Comments

vico93 picture vico93  路  5Comments