-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using nonInsertable/nonUpdateable
columns with JOINED
inheritance type triggers SQL error
#9467
Comments
ORM 2.9 is not maintained anymore. Can you please try to reproduce your problem with a recent release? If this issue still occurs, please provide steps to reproduce your problem. |
This must be 2.11 since it uses a new feature |
Thanks for the version fix, I overlooked the version number.... |
There wasn't any check for fields with notInsertable mapping at JoinedSubclassPersister's getInsertColumnList. This causes more column in the resulting SQL Insert query than expected when insertable=false is set on a field of joined subclass. A test is created for this case.
phpcbf is applied to the code
I'm experiencing a related issue in ORM 2.13.3, I think it's strongly related based op superficial debugging. I have the following field in an abstract entity used in single table inheritance:
The I suspect it's caused by the derived class not properly being aware that its base class contains the generated field. |
I'm getting the same issue in doctrine-bundle:2.8.2 and orm 2.14.0, using a MySQL database. Apparently the code that picks up the parameters respects the insertable flags, but the code that creates the SQL query does not. Minimal example: src/Entity/AbstractUser.php:
src/Entity/Customer.php:
src/Controller/DebugController.php:
Outcome after executing the route /debug (with
Expected outcome:
EDIT: The updatable flag (at least in my tests) worked as expected. It will cause an empty transaction if you only change the value of the updatable:false field, but that is acceptable imo. |
Bug report
JoinedSubclassPersister::getInsertColumnList()
does not take care ofnotInsertable
/notUpdateable
property of field mapping in parent class, therefore the column(s) appears in INSERT/UPDATE statement.This wrong behaviour generates a
DriverException
with the following message, becauseBasicEntityPersister::prepareUpdateData()
(correctly) does not provide the appropriate changeset:ORM version: 2.11
Follow up to #9118
The text was updated successfully, but these errors were encountered: