Skip to content

Better error handling in runProcessor() #9029

@BobRay

Description

@BobRay

bobray created Redmine issue ID 9029

Line 1557 of runProcessor:

if (!isset($this->error)) $this->request->loadErrorHandler();

If $modx->request is not set, MODX dies either silently or with a cryptic message in modParser, so a CLI script that tries to use a processor will fail unless the author knows enough to call $modx->getRequest() after initializing MODX.

Some possible fixes:

  • Put getRequest() in $modx->initialize()
  • Use getRequest() instead of $modx->request in runProcessor();
  • Die with a clear error message if $modx->request is not set in runProcessor()

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-corebugThe issue in the code or project, which should be addressed.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions