Issues

ZF2-514: Fatal error thrown when accessing merge method on non-existing object

Issue Type: Bug Created: 2012-09-01T19:22:51.000+0000 Last Updated: 2012-09-04T19:11:08.000+0000 Status: Resolved Fix version(s): - 2.0.0 (06/Sep/12)

Reporter: Andrew Collington (amnuts) Assignee: Ralph Schindler (ralph) Tags: - Zend\Db

Related issues: Attachments:

Description

A fatal error is thrown on line 576 of \Zend\Db\Sql\Select.php when trying to use Expr in a join, such as:

<pre class="highlight">
->join(
    array('u' => 'users'),
    'othertable.originator_id = u.id',
    array('person' => new Expr("IF(u.id = 1, NULL, u.username)"))
)

Comments

Posted by Andrew Collington (amnuts) on 2012-09-01T19:48:14.000+0000

Forgot to mention that line 576 just needs to have a check for $parameterContainer being non-empty, such as:

<pre class="highlight">
if ($parameterContainer) {
    $parameterContainer->merge($jColumnParts->getParameterContainer());
}

Posted by Koen Pieters (koen) on 2012-09-03T09:50:20.000+0000

Send a pull request for this: https://github.com/zendframework/zf2/pull/2291

Posted by Ralph Schindler (ralph) on 2012-09-04T19:11:08.000+0000

Fixed with @koen's patch.

Have you found an issue?

See the Overview section for more details.

Copyright

© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.

Contacts