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."

CommentFileSizeAuthor
#2 improve-exception-2941275-2.patch598 byteszuhair_ak

Comments

joachim created an issue. See original summary.

zuhair_ak’s picture

StatusFileSize
new598 bytes

I have changed the message as in the summary.

joachim’s picture

Status: Active » Needs review

That was fast!

Thanks!

Let's set this to Needs Review so the test bot runs it.

maxocub’s picture

Status: Needs review » Reviewed & tested by the community

Thank you for this improvement!

  • catch committed 5978c5f on 8.6.x
    Issue #2941275 by zuhair_ak, joachim: improve the exception message for...

  • catch committed fb2ebac on 8.5.x
    Issue #2941275 by zuhair_ak, joachim: improve the exception message for...
catch’s picture

Version: 8.6.x-dev » 8.5.x-dev
Status: Reviewed & tested by the community » Fixed

Committed/pushed to 8.6.x and cherry-picked to 8.5.x. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

jeremylichtman’s picture

Is 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.