API page: https://api.drupal.org/comment/reply/12215692

The example given for the substr plugin is invalid YAML. The start and length parameters should be indented the same amount as the source parameter.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

BenStallings created an issue. See original summary.

BenStallings’s picture

Issue summary: View changes
TR’s picture

Version: 8.4.x-dev » 8.6.x-dev

You're correct. How about providing a patch? That documentation is in core/modules/migrate/src/Plugin/migrate/process/Substr.php

swarad07’s picture

Status: Active » Needs review
FileSize
598 bytes

Adding patch for this. Please review.

TR’s picture

Status: Needs review » Reviewed & tested by the community

The small, simple patch in #4 fixes the documentation issue and doesn't affect any code.

Gábor Hojtsy’s picture

Status: Reviewed & tested by the community » Needs work
+++ b/core/modules/migrate/src/Plugin/migrate/process/Substr.php
@@ -33,8 +33,8 @@
- *       start: 6
- *       length: 10
+ *     start:
+ *     length: 10

Why is 6 getting lost from start?

kmbremner’s picture

correct patch based on comment #6

kmbremner’s picture

Status: Needs work » Needs review
mahalingam_cs’s picture

Status: Needs review » Reviewed & tested by the community
FileSize
4.22 KB

Patch in comment #7 fixed the issue reported in comment #6

larowlan’s picture

Removing review credit for @mahalingam_cs

@mahalingam_cs, please don't add screenshots of patches applied, we have the testbot for that.

Please see what we give credit for

larowlan’s picture

Adding credit for @Gabor Hojtsy as his review shaped the patch

  • larowlan committed c88ccd9 on 8.6.x
    Issue #2938645 by kmbremner, swarad07, Gábor Hojtsy: invalid YAML in...

  • larowlan committed 3a8ede6 on 8.5.x
    Issue #2938645 by kmbremner, swarad07, Gábor Hojtsy: invalid YAML in...
larowlan’s picture

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

Committed as c88ccd9 and pushed to 8.6.x.

Cherry-picked as 3a8ede6 and pushed to 8.5.x

Thanks

Status: Fixed » Closed (fixed)

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