Does the StaticMap handle source values of NULL, TRUE, or FALSE, and how should they be specified? Can they be distinguished from numeric 0, 1?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

joachim created an issue. See original summary.

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

Drupal 8.6.0-alpha1 will be released the week of July 16, 2018, which means new developments and disruptive changes should now be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

RoSk0’s picture

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

quietone’s picture

Status: Active » Needs review
FileSize
1.32 KB

How is this for documenting these cases?

joachim’s picture

Status: Needs review » Needs work

The examples look great!

Just some nitpicks:

  1. +++ b/core/modules/migrate/src/Plugin/migrate/process/StaticMap.php
    @@ -105,6 +105,34 @@
    + * the value of the  destination property bar will be 'to'.
    

    There's a double space here.

  2. +++ b/core/modules/migrate/src/Plugin/migrate/process/StaticMap.php
    @@ -105,6 +105,34 @@
    + * If your source data contains Booleans, the Boolean is treated as a numeric 0
    

    Nitpick, but I don't think we typically capitalise 'boolean'?

    A quick search in code finds things like this:

    31: * - active_table_sort: A boolean indicating whether the cell is the active
    36: * - no_striping: A boolean indicating that the row should receive no striping.

quietone’s picture

Status: Needs work » Needs review
FileSize
1.01 KB
1.32 KB

Thanks.

joachim’s picture

Status: Needs review » Reviewed & tested by the community

Looks great.

Thanks again for working on the patch!

alexpott’s picture

Version: 9.2.x-dev » 9.1.x-dev
Status: Reviewed & tested by the community » Fixed

Committed and pushed 45dee9bfc0 to 9.2.x and b80e41cf16 to 9.1.x. Thanks!

diff --git a/core/modules/migrate/src/Plugin/migrate/process/StaticMap.php b/core/modules/migrate/src/Plugin/migrate/process/StaticMap.php
index baea97ef0d..0d0c523425 100644
--- a/core/modules/migrate/src/Plugin/migrate/process/StaticMap.php
+++ b/core/modules/migrate/src/Plugin/migrate/process/StaticMap.php
@@ -122,7 +122,7 @@
  * destination property bar will be 'bar'. And if the value of the source
  * property 'foo' is FALSE then the value of the destination property bar will
  * be 'bar'.
-
+ *
  * @code
  * process:
  *   bar:

Fixed 125 | ERROR | [x] Doc comment star missing coding standard.

  • alexpott committed 45dee9b on 9.2.x
    Issue #2941323 by quietone, joachim: StaticMap should document how/...

  • alexpott committed b80e41c on 9.1.x
    Issue #2941323 by quietone, joachim: StaticMap should document how/...

Status: Fixed » Closed (fixed)

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