Created
October 21, 2023 06:49
-
-
Save jitendrapurohit/69aed123d6b6e769367a4add23200bc5 to your computer and use it in GitHub Desktop.
Fix required to migrate number field on d7 webform with select options.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/Plugin/migrate/source/d7/D7Webform.php b/src/Plugin/migrate/source/d7/D7Webform.php | |
index cf58dba..00ad5c4 100644 | |
--- a/src/Plugin/migrate/source/d7/D7Webform.php | |
+++ b/src/Plugin/migrate/source/d7/D7Webform.php | |
@@ -442,7 +442,7 @@ class D7Webform extends DrupalSqlBase implements ImportAwareInterface, RollbackA | |
$max = $extra['max']; | |
$step = !empty($extra['step']) ? $extra['step'] : 1; | |
for ($value = $min; $value <= $max; $value += $step) { | |
- $new_element[$value] = $value; | |
+ $new_element['#options'][$value] = $value; | |
} | |
} | |
foreach (['min', 'max', 'step'] as $property) { |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment