Problem/Motivation
In #2912353: Handle menu_items related to Drupal 6 and 7 node translations with different IDs we added a new configuration option validate_route to ignore route validation but there is no documentation in the plugin's annotation to document it.
Proposed resolution
Let's document this plugin.
Also, we should figure out and document (or fix) why the plugin expects an array and then only use the first item:
public function transform($value, MigrateExecutableInterface $migrate_executable, Row $row, $destination_property) {
list($path) = $value;
[...]
}
Remaining tasks
- Write documentation
- Figure out why the plugin expects an array and only use the first item
- Review
User interface changes
None.
API changes
None.
Data model changes
None.
| Comment | File | Size | Author |
|---|---|---|---|
| #15 | 2954908-15.patch | 1.54 KB | idebr |
Comments
Comment #2
maxocub commentedComment #4
fenstratComment #5
mr.baileysThis plugin was initially added in #2417793-13: Allow entity: URIs to be entered in link fields, but the issue thread does not focus on the plugin itself (initially called
userpath_uri). I dug through all commits for theLinkUriprocess plugin, but as far as I can track down, there is no reason (and never was) to expect an array as input, and requiring it to be an array seems to be unintentional.Patch attached that contains a first attempt at documenting the
LinkUriplugin, while at the same time deprecating the option to pass in an array as source value. Not sure if this deprecation strategy is acceptable, or if the deprecation itself requires a test.Comment #6
phenaproximaThe documentation looks good, but this patch is making a lot of changes which are not related to the documentation at all. Those changes are fine and good, but they are out of scope for this issue. It'd be better to remove all non-documentation changes from the current patch, then open a separate issue to streamline the value handling.
Comment #7
mr.baileysThanks @phenaproxima, I have opened #3031528: LinkUri source value should not be an array. to address the source value handling.
Comment #9
mr.baileys#3031528: LinkUri source value should not be an array. has landed, here is a patch with just the documentation changes from the patch in #5.
Comment #10
mikelutzLGTM Thanks!
Comment #12
mikelutzLooks like a testbot hiccup
Comment #13
quietone commentedYes, really thanks!
I've got a few points though.
Documenting deprecated behaviour seems wrong to me. Is this normally done? I'd prefer it was removed
The example needs an explanation following it, after the @endcode. This was done for all the ones in migrate and we should keep up the practice.
Remove the quotes, they are not needed
Comment #14
idebr commented#13.1 Removed the documentation for the deprecated usage. The deprecated usage is already documented in the
@trigger_errorfunction:#13.2 Added an explanation with an example entry, similar to for example
\Drupal\migrate\Plugin\migrate\process\Concat#13.3 Removed the quotes.
Comment #15
idebr commentedFixed the magically changing node id.
Comment #16
fenstrat@quietone's review from #13 has been address, this looks RTBC to me.
Comment #18
yogeshmpawarAll looks good so setting back to RTBC! Tests failure is not related (see #3055648: Frequent random fail in \Drupal\Tests\media_library\FunctionalJavascript\MediaLibraryTest).
Comment #20
idebr commentedSame random failure as mentioned in #18.
Comment #21
xurizaemonSomebody get testbot a glass of water!
Comment #23
catchCommitted fdccb84 and pushed to 8.8.x. Thanks!