-
Notifications
You must be signed in to change notification settings - Fork 369
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Error with null dates #181
Comments
NULL and empty string are different, so this wouldn't be appropriate, I think. One way to handle it is to add |
@tag: The problem is that the field is of DATE type. If I set it to a |
There won't be any casting on NULL to an empty string for the reasons @tag I am not sure why there is an issue with Twig, but a number of users have Unfortunately I have never experienced this bug despite using both Idiorm |
I'll try to create a simple project where the problem arises. |
I use Twig as well, and for various design reasons haven't encountered this error. Off the top of my head, I wonder whether a custom Twig filter might help with the issue as well. |
This is a thread where there is the same problem. This solution is a little forced. The real problem is that the application crashes when you try to access to that field via twig. Even a simple check to see if the variable is defined leads to a crash. I created this project to reproduce the same issue. Check it and the instructions in README.md. |
Hi, Same issue here :( |
Thank you for all the effort you have put in here. Does anyone have any time to put together a pull request that fixes this issue? I am struggling to find the time to test this out. |
offsetExists() should return true for null values, resolves #181
I have a database with 'birth_date' column, which can be NULL or a date.
If I use plain 'echo' to output birth_day, it works in either case - as null and as a date.
If however I'm using Twig as a template engine and accessing birthday through Twig, it works ONLY when there is a date. If there is NULL, then application crashes and browser gives me back ERR_EMPTY_RESPONSE. Nothing more.
I'm pretty sure the problem occurs somewhere in the ORM, but I can't figure out how to solve it. I'd like to have just and empty string outputed in Twig if there's a NULL in db.
This isn't a problem of Twig because if I pass to it a null value, it simply doesn't print it.
The text was updated successfully, but these errors were encountered: