Zend\Db\Metadata\Source\AbstractSource Notice: Undefined index #3719
Conversation
(AbstractSource::getConstraintKeys): Add call to child::loadConstraintReferences() and child::loadConstraintDataKeys() to avoid triggering PHP notices for constraint_references and constraint_keys
@ashawley Could you please attach a unit test that reproduces this behavior? @ralphschindler I'm assigning this issue to you. You may know a little more about the referenced missing ConstraintKeyObject class. |
@Freeaqingme I would have attached a unit test but didn't see any unit tests for Zend\Db\MetaData. |
Let me know if there really are no unit tests for Zend\Db\Metadata. I assumed TDD was done for all modules in ZF2. I wondered if someone forgot to commit the unit tests since the ConstraintKeyObject class is also missing. If there are no unit tests for Zend\Db\Metadata, I'd be willing to volunteer to write them. |
New unit test for #3719.
There's a unit test using a Sqlite DB adapter. Hope that helps. |
The Travis builds that are are broken are for unit tests unrelated to these -- Zend\Captcha\Image. |
@ashawley Thank you for providing unit tests with this issue. That's really helpful. There are two minor issues that come to mind still: Could you please add some docblocks to the two methods you introduce (I'm seeing some other methods in that class don't have them either - feel free to update those as well =) )? Also, could you perhaps give your unit tests a @group annotation that refers to this issue? That may help others in the future to find out what issue these tests actually test for. I'm not enough into Zend\Db to be comfortable merging this, @ralphschindler could you take upon reviewing this issue? |
@Freeaqingme I've added docblocks and a group annotation. Thanks for reviewing my changes. |
I've got this on my list for early next week as I'll be doing Db integration testing. |
Just saw that Zend\Db\Metadata\Object\ConstraintKeyObject was deleted last year in b9b7875e. I'm not sure why. |
I'm using my own Metadata source, but I'm pretty confident this occurs for the existing sources (Mysql, Postgresql, Sqlserver, ...).
Produces the following errors:
Note that after this fixing this error I run into the next one:
Was that class just never committed?