Closed amerker closed 10 years ago
I believe that this problem is addressed in issue #74 and related pull request #75.
Hey i just saw that you had already posted a comment to #75. Sorry
I think that this is associated to https://github.com/j4mie/idiorm/issues/181 .
Hi there,
i've had this infinite recursion issue as well.
This says its in the development branch, and there is text for a release 1.5, but I don't see it as actually being released yet. Wondering when it will be? Using composer to pull and not sure how to get a non release branch (am new to a lot of this, sorry)
@petersmithca you can change your composer requirements to point to dev-develop so the line would look like:
"j4mie/idiorm": "dev-develop"
I am working to get the 1.5.0 release out soon, but I am very short on time with paid work taking priority at the moment. It would be great if you could test your issue against the develop branch mentioned above for me though.
This issue has been fixed in Idiorm.
In Paris 1.4.1 and Idiorm 1.4.0, when trying to access DB fields with NULL as value from Twig (via
{{ object.field }}
), I get infinite recursions.This is when building the object using
find_one()
, orfind_many()
with a Twig loop, whilefind_array()
works as expected.Here's a barebones system that should demonstrate the problem:
DB (MySQL):
Model and Slim Route:
Twig:
This always throws an infinite recursion to which Xdebug predictably reacts with:
Twig does not render the third output line (corresponding to the third db row) after that. As soon as I replace
find_many()
withfind_array()
in the Slim Route, it all works.Also, the infinite recursion occurs when using Twig's
{% if row.nullableField %}
, but not when using{% if row.nullableField is defined %}
. The latter always returns true - interestingly enough on ANY field name, even nonexistent ones, which is something I would maybe regard as a bug as well.Using j4mie/paris 1.4.1, j4mie/idiorm 1.4.0, slim/slim 2.3.5, slim/views 0.1.0, twig/twig 1.14.2.