Skip to content

modError::hasError() returns false positive when loaded via getService() #9165

@opengeek

Description

@opengeek

opengeek created Redmine issue ID 9165

modError::hasError() returns true automatically after loading modError via getService calls like:

$modx->getService('error', 'error.modError');

This is because getService passes the second parameter to modError's constructor as an empty array, instead of an empty string. Since hasError checks for $this->message != '', and array() != '', many processors fail with a general error but with no error messages.

Loading it like this gets around the problem for now:

$modx->getService('error', 'error.modError', '', '');

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