mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
DDC-3953: Text field is returned null from MySQL even if field has text #4833
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @doctrinebot on GitHub (Oct 14, 2015).
Originally assigned to: @beberlei on GitHub.
Jira issue originally created by user gabiudrescu:
I have an entity where I was trying to add a new text field (description). The YML is listed below:
I have run the required commands:
The following SQL command ran:
I have persisted a few entities where the description contains a hash sign (#) and after trying to retrieve that description in an HTML page, I noticed the field was empty (null).
So, in order to remove all doubts about doing something wrong, I did the following experiment:
This code rendered:
But if I retrieve the same entity by ID from my database, the description field is null:
Also, other entities, if returned from MySQL they have the description field null - although PHPMyAdmin shows the field with text.
I have tried this solution http://stackoverflow.com/questions/22282490/doctrine-2-entity-field-is-null-when-database-field-contains-certain-special-cha or http://stackoverflow.com/questions/16079081/doctrine-2-3-text-field-is-not-saved-because-of-special-characters but with no luck :(
Any ideas why this arbitrary field stopped working as supposed?
@doctrinebot commented on GitHub (Oct 14, 2015):
Comment created by gabiudrescu:
same issue with other already created entities. but with newly created entities it works. I suspect some mysql issue.
@doctrinebot commented on GitHub (Oct 15, 2015):
Comment created by gabiudrescu:
fresh new ideas in the morning: dropping the database, creating it again. now it works - entity description is retrieved accordingly from database.
I have no idea why last night wasn't working. any feedback is much appreciated - i hate the feeling of having something working and don't know why.