-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
checkbox title/description conundrum #11
Comments
FYI here is a custom patch I use to fix migration of single checkboxes (issue with #title / #description) diff --git a/src/Plugin/migrate/source/d7/D7Webform.php b/src/Plugin/migrate/source/d7/D7Webform.php
index 7633c98..d563a1e 100644
--- a/src/Plugin/migrate/source/d7/D7Webform.php
+++ b/src/Plugin/migrate/source/d7/D7Webform.php
@@ -353,7 +353,16 @@ class D7Webform extends DrupalSqlBase implements ImportAwareInterface, RollbackA
elseif (!empty($extra['multiple']) && count($valid_options) == 1) {
$select_type = 'checkbox';
list($key, $desc) = explode('|', $extra['items']);
- $markup .= "$indent '#description': \"" . $this->cleanString($desc) . "\"\n";
+ // Use 'description' as title, and use 'after' display for unique checkbox
+ // $element['name'] = $this->cleanString($desc);
+ $element['name'] = $desc;
+ $extra['title_display'] = 'before';
+
+ // Force #multiple key
+ $extra['multiple'] = false;
+
+ // Do not populate '#description' key as is generate "Duplicate key" errors.
+ // $markup .= "$indent '#description': " . $this->cleanString($desc) . "\"\n";
}
else {
$select_type = 'radios'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
#type => checkbox
In D7 you have a div wrapping a single checkbox where the element title goes on the div and the single checkbox option becomes the title of the checkbox
In D8 as it stands we end up a single checkbox , the element title becomes
#title
and the single checkbox option becomes#description
. This is wildly different from D7. Perhaps a #prefix / #suffix replicating the wrapping div (not sure whether webform supports) and keeping the checkbox option as title would work better?The text was updated successfully, but these errors were encountered: