modAction and related
modAction related functionality has been removed in MODX3. This was accompanied by a cleanup of the
This means that manager URLs in the form of
15 is the ID of an action) will no longer work. Extras that rely on it must be updated to use namespace-based routing instead, in the form of
For some extras, this may require rewriting controllers. For others, simply changing the menu definition (in System > Menus) is sufficient.
With the removal of actions, the actionMap no longer serves a purpose, and has been removed.
modX::$actionMap, the method that generates it
modCacheManager::generateActionMap() has also been removed.
Used to fill
modX::$actionMap, has been removed.
Changed: parameters passed to OnBeforeManagerPageInit event¶
Previously, OnBeforeManagerPageInit received an
$action parameter as an array. Now, it includes the following parameters:
string $namespacethe namespace for the request
string $namespacePaththe (core) path for the namespace
string $actionthe router/action in the namespace
No known uses of this constant, so it has been removed.
Changed: throwing exceptions¶
When initialising a controller, you can now throw a new exception
MODX\Revolution\Controllers\Exceptions\AccessDeniedException. These will be handled by the
modManagerResponse class to show a nicer error page.
Make sure to provide a useful message in the exception.
This also supports returning a falsey return value from
modManagerController::checkPermissions, but that does not allow providing a custom message unless you throw the exception yourself.
\Errors triggered by the rendering of a controller will also be caught now.
As the logic for loading controllers has been refactored in
instantiateController methods have been removed.
Some signatures have slightly changed:
checkForMenuPermissions(string $action): boolnow defines the
stringparameter type and
getControllerClassName(string $action): stringnow requires the
$actionto be provided and either returns a string or throws a