Skip to content
This repository was archived by the owner on Jan 29, 2020. It is now read-only.

Fix 'Call to a member function hasChildren() on boolean' #26

Closed
wants to merge 1 commit into from

Conversation

skl
Copy link
Contributor

@skl skl commented Sep 8, 2015

  • This seems to occur when the DefaultRenderingStrategy tries to render
    a result that is not an instance of Zend\View\Model\ModelInterface, in
    my case the result was a boolean true.
  • I'm checking for ModelInterface rather than ConsoleModel as the render
    method seems to work with any ModelInterface, not just ConsoleModel

- This seems to occur when the DefaultRenderingStrategy tries to render
  a result that is not an instance of Zend\View\Model\ModelInterface, in
  my case the result was a boolean true.
- I'm checking for ModelInterface rather than ConsoleModel as the render
  method seems to work with any ModelInterface, not just ConsoleModel
@@ -42,7 +43,7 @@ public function render(MvcEvent $e)
// marshal arguments
$response = $e->getResponse();

if (empty($result)) {
if (empty($result) || !($result instanceof ModelInterface)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can simply remove the empty() call

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Except this comment, all of your other comments relate to the existing test code that I copied. So I'll apply your suggestions to both tests - I was just following what was already there :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@skl thanks!

@Ocramius Ocramius added the bug label Sep 8, 2015
@Ocramius Ocramius added this to the 2.5.2 milestone Sep 8, 2015
@Ocramius
Copy link
Member

Ocramius commented Sep 8, 2015

👍 (except nitpicking)

@skl skl closed this Sep 8, 2015
@skl skl deleted the calling-function-on-boolean branch September 8, 2015 13:21
@skl
Copy link
Contributor Author

skl commented Sep 14, 2015

@Ocramius not sure if you saw but I incorporated your comments into #27

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants