I'm using the following:

Webform 7.x-3.20
Matrix 7.x-4.0
Arrange Fields 7.x-1.15

I am not able to move a Matrix by using the Arrange Fields module. Is there a way to make this possible, or is it not compatible at all?

Thanks

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

chetan-singhal’s picture

I will look into this soon.

chetan-singhal’s picture

Hi

Replace arrange_fields.module file line no 880

From
$element_type = af_get($element["#type"]);

To

if (module_exists("webform_matrix_component")) {
            $element_type = af_get($element['#webform_component']['type']);
        } else {
            $element_type = af_get($element["#type"]);
        }

Your problem will solve.

chetan-singhal’s picture

Status: Active » Fixed
kyleheney’s picture

Thanks a lot for your help! This worked perfectly!

That line for me was on line 924 though.

chetan-singhal’s picture

Component: Documentation » Code
Assigned: Unassigned » chetan-singhal
Status: Fixed » Closed (fixed)
chetan-singhal’s picture

Project: Webform Matrix Component » Arrange Fields
Version: 7.x-4.0 » 7.x-1.15

I'm using the following:

Webform 7.x-3.20
Matrix 7.x-4.0
Arrange Fields 7.x-1.15

I am not able to move a Matrix by using the Arrange Fields module. Is there a way to make this possible, or is it not compatible at all?

Thanks

chetan-singhal’s picture

Status: Closed (fixed) » Needs work
chetan-singhal’s picture

Please find patch for this.

chetan-singhal’s picture

Assigned: chetan-singhal » Unassigned
Status: Needs work » Needs review
kyleheney’s picture

I found an error with your coding change.

By adding the code you provided, the Arrange Fields module can no longer move the submit button. I tried reverting back to original code and the submit button can be moved again.

This code also moves the Submit button to the top of every form (original location I guess) and it cannot be moved, even if there is no Matrix Component in the form.

kyleheney’s picture

Status: Needs review » Needs work
kyleheney’s picture

Any update on this one? The previous fix resulted in the Submit button moving to the top of all forms and prevents it from being able to be moved. Thanks

richardp’s picture

I'm sorry I haven't had a chance to look into this further yet.

I don't think the fix described in #2 would work because if the matrix module is installed AT ALL, it will ignore all other types of fields other than webform fields. That's why the submit button isn't working anymore for kyleheney.

If you notice, near that code in the original file, I have a special section for Captcha module and maybe one or two others. That type of logic should be used to detect ONLY the matrix field itself.

Richard

kyleheney’s picture

Thanks for the update. I'll look forward to a modified fix in the future (hopefully!). It would be great to be able to move Matrices freely like other elements can be moved.