Skip to content

Commit

Permalink
de465d5 part 2
Browse files Browse the repository at this point in the history
  • Loading branch information
Brad Bell committed May 22, 2018
1 parent de465d5 commit e6e16d9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/elements/db/ElementQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -1569,7 +1569,7 @@ private function _applyRelatedToParam()
}

$parser = new ElementRelationParamParser([
'fields' => ArrayHelper::index($this->customFields, 'handle')
'fields' => $this->customFields ? ArrayHelper::index($this->customFields, 'handle') : []
]);
$condition = $parser->parse($this->relatedTo);

Expand Down
3 changes: 2 additions & 1 deletion src/elements/db/ElementRelationParamParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,15 @@
use craft\fields\Matrix;
use craft\helpers\StringHelper;
use craft\models\Site;
use yii\base\BaseObject;

/**
* Parses a relatedTo param on an ElementQuery.
*
* @author Pixel & Tonic, Inc. <[email protected]>
* @since 3.0
*/
class ElementRelationParamParser
class ElementRelationParamParser extends BaseObject
{
// Constants
// =========================================================================
Expand Down

0 comments on commit e6e16d9

Please sign in to comment.