If an extract process plugin currently is unable to match a row it throws a migration exception and stops the entire migration. This may some times be expected behavior but many times the extracted value is a soft requirement and can be handled with a default value.

The attached patch implements this and provides an example of its usage in menu link migration.

Comments

Status: Needs review » Needs work

The last submitted patch, migrate_extract_default_option.patch, failed testing.

neclimdul’s picture

Status: Needs work » Needs review
StatusFileSize
new4.53 KB
new428 bytes

I'd like to say, I totally manually mucked with this and manually made the md5 so neener neener hashing "protection".

mikeryan’s picture

I admit I didn't follow the IRC discussion too closely - why not replace the exception with simply returning a NULL value, and using the default_value plugin in the migration?

neclimdul’s picture

I don't know that we discussed that specifically. We did discuss bypass behavior similar to map but to address your question, how do we know NULL isn't a matched value?

neclimdul’s picture

neclimdul’s picture

neclimdul’s picture

StatusFileSize
new4.53 KB

reroll around the great migration move of 2015

phenaproxima’s picture

Status: Needs review » Reviewed & tested by the community

This looks good to me, and I could see it being useful.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

This looks useful to me to. Migrate is exempt from beta evaluation. Committed 5a03edb and pushed to 8.0.x. Thanks!

  • alexpott committed 5a03edb on 8.0.x
    Issue #2511632 by neclimdul: Add ability to provide default for Extract...

Status: Fixed » Closed (fixed)

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