This is a followup to #2216697: Add the ability to clone form builder components.

We currently have the ability to clone individual fields, but not entire fieldsets. The Webform module itself allows this, and it would be nice to have this when Form Builder takes over the UI as well.

CommentFileSizeAuthor
#3 2361217_clone_fieldset.patch3.3 KBgovshareadmin

Comments

jony_niuqiang’s picture

Title: Add ability to clone entire fieldsets in Webform » Add ability to clone entire fieldsets in Form builder
jony_niuqiang’s picture

Thank you very much ! As I see inside the Form builder,I found the some code like this:

  if ($op == 'clone') {
    // Unique fields cannot be cloned (or otherwise they would not be unique).
    // Cloning fieldsets is also not currently supported.
    $fields = form_builder_get_form_type($form_type);
    $access = !empty($element['#form_builder']['element_type']) && empty($fields[$element['#form_builder']['element_type']]['unique']) && $element['#form_builder']['element_type'] != 'fieldset';
  }

You let the componet can be cloned but the 'fieldset' componet. I attempt to change "$access = TRUE;", Yeah , the fieldset componet can be cloned.But the question is that its children components can't be cloned . Can you give me some ideas to do with this?

govshareadmin’s picture

StatusFileSize
new3.3 KB

I created a patch for it. it works fine, instead of some cases.

govshareadmin’s picture

This patch works for form builder version 7.x-1.22.