mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
BUGFIX Added E_USER_ERROR error to ComponentSet::getExtraData() if a NULL component name is passed
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@71640 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
1cb6b5c8ee
commit
569447d2ba
@ -73,13 +73,15 @@ class ComponentSet extends DataObjectSet {
|
||||
$parentField = $this->ownerClass . 'ID';
|
||||
$childField = ($this->childClass == $this->ownerClass) ? 'ChildID' : ($this->childClass . 'ID');
|
||||
$result = array();
|
||||
|
||||
if(!isset($componentName)) {
|
||||
user_error('ComponentSet::getExtraData() passed a NULL component name', E_USER_ERROR);
|
||||
}
|
||||
|
||||
if(!is_numeric($childID)) {
|
||||
user_error('ComponentSet::getExtraData() passed a non-numeric child ID', E_USER_ERROR);
|
||||
}
|
||||
|
||||
if(!$componentName) return false;
|
||||
|
||||
// @todo Optimize into a single query instead of one per extra field
|
||||
$extraFields = $ownerObj->many_many_extraFields($componentName);
|
||||
if($extraFields) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user