-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Fix call to method not in ExpressionInterface #7292
Conversation
The ExpressionInterface does not have the method getExpression
@marcelto Can you please provide a unit test that would hit this particular condition? |
test case SelectTest::testBadJoinName
third arg not an array
Ok,the test case has been added. I ended up changing |
$joinName = $joinName->getExpression(); | ||
} elseif ($joinName instanceof TableIdentifier) { | ||
$joinName = $joinName->getTableAndSchema(); | ||
$joinName = ($joinName[1] ? $platform->quoteIdentifier($joinName[1]) . $platform->getIdentifierSeparator() : '') . $platform->quoteIdentifier($joinName[0]); | ||
} elseif ($joinName instanceof Select) { | ||
$joinName = '(' . $this->processSubSelect($joinName, $platform, $driver, $parameterContainer) . ')'; | ||
} elseif (is_string($joinName) || (is_object($joinName) && method_exists($joinName, '__toString'))) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use is_callable()
instead of method_exists()
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can the magic method __toString
be something else than public
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated to is_callable(array($joinName, '__toString'))
during merge.
So it seems it can be but it shouldn't be anything but public. Using
|
Fix call to method not in ExpressionInterface Conflicts: library/Zend/Db/Sql/Select.php
Merged to develop for release with 2.4. |
The ExpressionInterface does not have the method getExpression