0

I have been using Migrate API as a means to pull in RSS Data as nodes. Currently in Drupal 8 it doesn't seem there is any other reasonable way to do this.

One of my fields is a link that ends in a series of 6 numbers. I need those numbers as an id to go into the url. The substr plugin seems like it would be perfectly suited to accomplish this, but doesn't seem to work at all.

What I have in my YAML file :

grantid: 
-
  plugin: substr
  source: guid
    start: 61
    length: 6

The error in my drush window when I attempt to even install the module that uses the plugin.

Unable to parse at line 61 (near "  start: 5").' in /var/beetbox/core/lib/Drupal/Core/Config/FileStorage.php:117

Currently I'm looking into using explode, but this is certainly not an ideal solution. Does anyone have some insight on why this plugin wouldn't work? It works fine without using this plugin.

Update : It does seem that was the problem. Thanks for the help.

  • 4
    I think the error is informing you that the YAML is not correct. The start and length should be on the same indentation as source because source is not a mapping or sequence. – mradcliffe Nov 22 '16 at 0:12
3

Answered at https://www.drupal.org/node/2829462 - as mradcliffe says, this is a YAML syntax error.

| improve this answer | |
  • Yes, That was the issue. Thanks for the help. Also, are you the same Mike Ryan that RUNS the Migrate API and PathAuto Modules??? Thank you for all of your great work! – GT Tech Life Nov 22 '16 at 19:58
  • Yep, I was the original author of the migrate and pathauto contrib modules. – Mike Ryan Dec 4 '16 at 16:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.