Problem/Motivation
When attempting to run drush migrate-upgrade (provided by migrate_upgrade module), I get
The [path]/web/modules/contrib/ip2country/migrations/d7_ip2country_date_formats.yml contains invalid YAML. Non-string keys are not supported. Quote your evaluable mapping keys instead at line 11 (near "true: 'true'").
Steps to reproduce
Point drush migrate-upgrade at a Drupal 7 site where ip2country module is enabled.
Proposed resolution
Put the true and false keys in quotes: 'true': 'true' and 'false': 'false'.
Remaining tasks
Make a pull request with this change.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | 3185283-4-boolean.patch | 838 bytes | tr |
| #3 | add_quotes-3185283-2.patch | 509 bytes | benstallings |
Issue fork ip2country-3185283
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
benstallings commentedI wasn't able to get the Gitlab workflow to work for me, so here's a patch.
Comment #4
tr commentedOK, but I'm curious as to why this is failing. That is NOT invalid YML and the keys should not have to be quoted - they are strings and contain no special characters that require quoting. That error message is generated by Symfony, not by migrate_upgrade or by core, so perhaps this is a change introduced in a recent version of Symfony? It seems the Symfony YAML parser is trying to determine the datatype of the key, but since keys must be strings it should instead always be interpreting those keys as strings. So a key named 1 should be valid, since it should be interpreted as the string '1' not the number 1. Likewise, key named true should be interpreted as a string 'true' not as a boolean.
Anyway, I guess we should just avoid this problem. Here's a variation of your patch where I just renamed those keys instead of quoting them - I think this makes the .yml easier to read and understand.
Can you try this to see if it fixes the problem for you?
Comment #6
tr commentedCommitted #4.
Comment #7
tr commented