Skip to content

v3 Manager actions with parse errors - admin Resource delete issue, editor can't open Resource #2032

@nick0

Description

@nick0

(edit: I misread the version as 3.1.17 instead of 3.1.7)

Hello,

I recently updated my starter site from 1.4.15 to 3.1.7 using the Migration plugin and have a couple of puzzling (presumably permissions related) parse issues.

I'm looking for some high level / technical help from @Dmi3yy and/or the devs please.

The same parse issues detailed below happen with new users and new roles - and with or without a custom manager folder name.

The site is using php 7.4.

Confirming that these things do not happen in the 1.4.15 site that this site was migrated from - everything works as expected in the Evo 1 Manager.

Also posted here in the forum if interested.

1 Administrator role

When I delete a Resource (aka a page in the LHS site tree), the Parse Error "Call to a member function toArray() on null" is thrown with a popup that says "You do not have the correct permissions for this resource".

evo-3-1-17-delete-resource-error

The Resource still gets the red strike through (eg so it is actually deleted) but something is obviously not quite right given the error is thrown.

This is with the main / only Administrator account.

Same parse error occurs with a totally new user with the Administrator role trying to delete a Resource.

I created a totally new Admin user but experience the exact same issue when trying to delete a Resource.

In checking out Users > Roles, the Administrator role is greyed out and says "This role cannot be edited or deleted." I presume that to mean I should have maximum editing capabilities for all users with the Administrator Role. Why I can't delete a brand new Resource like normal is beyond my skill set.

Here is a copy of the parse error...

Parser / Call to a member function toArray() on nu - System Events
Event Id: 	0 	Source: 	Parser / Call to a member function toArray() on nu

« Evolution CMS Parse Error »
Call to a member function toArray() on null
Error information 	
File 	/home/my-site/public_html/my-custom-manager/actions/mutate_content.dynamic.php

Backtrace
Illuminate\Support\Facades\Facade::__callStatic('handleRoute', array $var2)
my-custom-manager/index.php on line 162
EvolutionCMS\ManagerTheme->handleRoute()
core/vendor/illuminate/support/Facades/Facade.php on line 261
Illuminate\Routing\Router->dispatch(Illuminate\Http\Request $var1)
core/src/ManagerTheme.php on line 407
Illuminate\Routing\Router->dispatchToRoute(Illuminate\Http\Request $var1)
core/vendor/illuminate/routing/Router.php on line 625
Illuminate\Routing\Router->runRoute(Illuminate\Http\Request $var1, Illuminate\Routing\Route $var2)
core/vendor/illuminate/routing/Router.php on line 636
Illuminate\Routing\Router->runRouteWithinStack(Illuminate\Routing\Route $var1, Illuminate\Http\Request $var2)
core/vendor/illuminate/routing/Router.php on line 672
Illuminate\Pipeline\Pipeline->then(Closure $var1)
core/vendor/illuminate/routing/Router.php on line 697
Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Illuminate\Http\Request $var1)
core/vendor/illuminate/pipeline/Pipeline.php on line 103
EvolutionCMS\Middleware\VerifyCsrfToken->handle(Illuminate\Http\Request $var1, Closure $var2)
core/vendor/illuminate/pipeline/Pipeline.php on line 167
Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Illuminate\Http\Request $var1)
core/src/Middleware/VerifyCsrfToken.php on line 13
EvolutionCMS\Middleware\Manager->handle(Illuminate\Http\Request $var1, Closure $var2)
core/vendor/illuminate/pipeline/Pipeline.php on line 167
Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Illuminate\Http\Request $var1)
core/src/Middleware/Manager.php on line 25
Illuminate\Session\Middleware\StartSession->handle(Illuminate\Http\Request $var1, Closure $var2)
core/vendor/illuminate/pipeline/Pipeline.php on line 167
Illuminate\Session\Middleware\StartSession->handleStatefulRequest(Illuminate\Http\Request $var1, Illuminate\Session\Store $var2, Closure $var3)
core/vendor/illuminate/session/Middleware/StartSession.php on line 64
Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Illuminate\Http\Request $var1)
core/vendor/illuminate/session/Middleware/StartSession.php on line 121
Illuminate\Routing\Middleware\SubstituteBindings->handle(Illuminate\Http\Request $var1, Closure $var2)
core/vendor/illuminate/pipeline/Pipeline.php on line 167
Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Illuminate\Http\Request $var1)
core/vendor/illuminate/routing/Middleware/SubstituteBindings.php on line 50
Illuminate\View\Middleware\ShareErrorsFromSession->handle(Illuminate\Http\Request $var1, Closure $var2)
core/vendor/illuminate/pipeline/Pipeline.php on line 167
Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Illuminate\Http\Request $var1)
core/vendor/illuminate/view/Middleware/ShareErrorsFromSession.php on line 49
Illuminate\Routing\Router->Illuminate\Routing\{closure}(Illuminate\Http\Request $var1)
core/vendor/illuminate/pipeline/Pipeline.php on line 128
Illuminate\Routing\Route->run()
core/vendor/illuminate/routing/Router.php on line 695
Illuminate\Routing\Route->runController()
core/vendor/illuminate/routing/Route.php on line 205
Illuminate\Routing\ControllerDispatcher->dispatch(Illuminate\Routing\Route $var1, EvolutionCMS\Controllers\Actions $var2, 'handleAction')
core/vendor/illuminate/routing/Route.php on line 262
EvolutionCMS\Controllers\Actions->handleAction()
core/vendor/illuminate/routing/ControllerDispatcher.php on line 48
EvolutionCMS\ManagerTheme->handle(27)
core/src/Controllers/Actions.php on line 27
Illuminate\View\View->render()
core/src/ManagerTheme.php on line 420
Illuminate\View\View->renderContents()
core/vendor/illuminate/view/View.php on line 91
Illuminate\View\View->getContents()
core/vendor/illuminate/view/View.php on line 122
Illuminate\View\Engines\PhpEngine->get(string $var1, array $var2)
core/vendor/illuminate/view/View.php on line 139
Illuminate\View\Engines\PhpEngine->evaluatePath(string $var1, array $var2)
core/vendor/illuminate/view/Engines/PhpEngine.php on line 38
Illuminate\Filesystem\Filesystem->getRequire(string $var1, array $var2)
core/vendor/illuminate/view/Engines/PhpEngine.php on line 58
Illuminate\Filesystem\Filesystem::Illuminate\Filesystem\{closure}()
core/vendor/illuminate/filesystem/Filesystem.php on line 108
require(string $var1)
core/vendor/illuminate/filesystem/Filesystem.php on line 107
include_once()
my-custom-manager/views/page/27.php on line 5

2 Editing / Publishing roles

When simply attempting to open a Resource, the Parse Error "Parser / SQLSTATE[42S22]: Column not found: 1054 U" is thrown.

The user cannot open any of the LHS tree Resources at all, I see the following on the top of the RHS frame.

evo-3-1-17-publisher-open-resource-error---roles

This is a copy of the parse error from the RHS frame:

Source: Parser / SQLSTATE[42S22]: Column not found: 1054 Unknown column 'modx_document_groups.document_group' in 'where clause' (SQL: select `modx_site_tmplvars`.*, `modx_site_tmplvar_contentvalues`.`value`, `modx_site_tmplvar_templates`.`rank` as `tvrank`, `modx_site_tmplvar_templates`.`rank`, `modx_site_tmplvars`.`id`, `modx_site_tmplvars`.`rank` from `modx_site_tmplvars` inner join `modx_site_tmplvar_templates` on `modx_site_tmplvar_templates`.`tmplvarid` = `modx_site_tmplvars`.`id` left join `modx_site_tmplvar_contentvalues` on `modx_site_tmplvar_contentvalues`.`tmplvarid` = `modx_site_tmplvars`.`id` and `modx_site_tmplvar_contentvalues`.`contentid` = 178 left join `modx_site_tmplvar_access` on `modx_site_tmplvar_access`.`tmplvarid` = `modx_site_tmplvars`.`id` where `modx_site_tmplvar_templates`.`templateid` = 5 and (`modx_site_tmplvar_access`.`documentgroup` is null or `modx_document_groups`.`document_group` in (1, 4)) order by `modx_site_tmplvar_templates`.`rank` asc, `modx_site_tmplvars`.`rank` asc, `modx_site_tmplvars`.`id` asc) - Editing resource - The details of the error could be seen in the Evolution CMS system events log.

No problems for these users accessing / editing chunks etc. Just Resources.

Confirming that I fully deleted the Editing and Publishing roles, cleared the cache and recreated new roles (albeit with the same names) with the same privelages.

evo-3-1-17-delete-resource-error---roles

Same thing happens for a User with the new roles. If I change the Role of a User to Administrator I can edit and save a Resource as expected - however per issue 1 above, I cannot delete a Resource without throwing that parse error with the pop up error.

@BBloke had a look at this for me. He thinks the reason it might be failing "is because the SQL statement doesn't know about the document_groups table and cannot apply a WHERE statement against it."
He played with the statement and got it working if he "left join that table into the statement. This is a core function and not something that can be messed with."
Not sure if that sheds any light on the issue for the devs?

Something very weird is going on in these roles / permissions that is beyond my understanding.

Any ideas on how to resolve?

Perhaps there is something lingering from 1.4.X in the database that you could please point me towards to look for and remove?

Please help devs.

I can give Evo 3.1.17 manger access to a demo site that experiences these same issues if you'd like to experience them and diagnose - just let me know how to get the details to you privately (eg an email address?).

Many thanks in advance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions