foreach (array_keys($source_ids) as $id) {
if (!$this->hasSourceProperty($id)) {
throw new \InvalidArgumentException("$id has no value");
}
}
This exception is thrown when the source row retrieved from the database doesn't have a value for a property which is specified as a migration source id.
The message could do to be clearer.
Eg: "$id is defined as a source ID but has no value."
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | improve-exception-2941275-2.patch | 598 bytes | zuhair_ak |
Comments
Comment #2
zuhair_akI have changed the message as in the summary.
Comment #3
joachim commentedThat was fast!
Thanks!
Let's set this to Needs Review so the test bot runs it.
Comment #4
maxocub commentedThank you for this improvement!
Comment #7
catchCommitted/pushed to 8.6.x and cherry-picked to 8.5.x. Thanks!
Comment #9
jeremylichtman commentedIs there any way in which the exception message could also indicate which migration?
I'm working on a project where there are hundreds of migrations configured, and somebody has messed up one of them. Finding it is a problem (the migrate tools listing page crashes), and catching this exception turns out to be tricky for some reason.