8000 modError::hasError() returns false positive when loaded via getService() · Issue #9165 · modxcms/revolution · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
opengeek opened this issue Nov 24, 2012 · 1 comment
Closed
Labels
area-core bug The issue in the code or project, which should be addressed.

Comments

@opengeek
Copy link
Member

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', '', '');
@opengeek
Copy link
Member Author

opengeek submitted:

b05039f

enigmatic-user pushed a commit to enigmatic-user/revolution that referenced this issue Feb 13, 2014
… getService

When invoking modError via $modx->getService('error', 'error.modError') the message parameter was being passed as an empty array to the modError constructor. This would cause processors to fail prematurely when no errors occurred because hasError() checks for $this->message != '', and array() != ''.
enigmatic-user pushed a commit to enigmatic-user/revolution that referenced this issue Feb 13, 2014
Merge branch 'release-2.2'

* release-2.2: (40 commits)
  Bump version for 2.2.6-pl
  [modxcms#9178] Use PHP time for valid check in modDbRegisterMessage::getValidMessages()
  [modxcms#9165] Fix modError::hasError false positives when loaded via getService
  [modxcms#9029] Remove modRequest->loadErrorHandler dependency in runProcessor
  [modxcms#9156] Fix reload data for rendering multi-value TV types properly
  Prevent re-mapping custom Policies and Policy Templates
  [modxcms#7916] Fix Area functionality in Element Properties and Property Sets
  [modxcms#9080] Disable allow_tags_in_post System Setting on upgrade
  Add configcheck warning for allow_tags_in_post settings enabled
  fix css misprints
  Remove recursion in onCellDblClick() modx.grid.local.property.js
  Updated Dutch lexicon
  Remove unnecessary connector call on login tpl
  Update phpdoc comment
  Image optimization applied across distribution (changelog entry)
  Image Optimization
  Fixed copyright 2011 to 2012
  [modxcms#9006] Fix ImageMagick which convert issue (PHP 5.3.2+)
  CS translation of updated strings in Setting Lexicon
  [modxcms#9080] Avoid filter order compromises in modX::sanitize()
  ...
danyaPostfactum pushed a commit to danyaPostfactum/revolution that referenced this issue Mar 26, 2014
… getService

When invoking modError via $modx->getService('error', 'error.modError') the message parameter was being passed as an empty array to the modError constructor. This would cause processors to fail prematurely when no errors occurred because hasError() checks for $this->message != '', and array() != ''.
danyaPostfactum pushed a commit to danyaPostfactum/revolution that referenced this issue Mar 26, 2014
* release-2.2:
  [modxcms#8101] Add support for httpOnly session cookies in PHP 5.2+
  Adding System Setting for HttpOnly cookies
  phpdoc comment correction
  [modxcms#8420] Add changelog entries for flock-independent file locking issues
  Bump version for 2.2.7-dev
  [#8423] Add multi-node support to flock-independent file locking
  Set log_level and log_target from xPDO constructor options
  Bump version for 2.2.6-pl
  [modxcms#9178] Use PHP time for valid check in modDbRegisterMessage::getValidMessages()
  [modxcms#9165] Fix modError::hasError false positives when loaded via getService
  [modxcms#9029] Remove modRequest->loadErrorHandler dependency in runProcessor
  [modxcms#9156] Fix reload data for rendering multi-value TV types properly
  Prevent re-mapping custom Policies and Policy Templates
  [modxcms#7916] Fix Area functionality in Element Properties and Property Sets
  [modxcms#9080] Disable allow_tags_in_post System Setting on upgrade
  Add configcheck warning for allow_tags_in_post settings enabled

Conflicts:
	_build/build.sample.properties
	_build/build.xml
	_build/data/transport.core.system_settings.php
	core/docs/changelog.txt
	core/docs/version.inc.php
	core/model/modx/modx.class.php
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-core bug The issue in the code or project, which should be addressed.
Projects
None yet
Development

No branches or pull requests

1 participant
0