MaxLazar / mx-select-plus

This add-on makes long, unwieldy select boxes much more user-friendly with the Chosen plugin.
Other
4 stars 4 forks source link

Error on submit: is_array() expects exactly 1 parameter, 0 given #2

Open rickprince opened 8 years ago

rickprince commented 8 years ago

When trying to add items within a matrix row, I get this error:

A PHP Error was encountered
Severity: Warning
Message: is_array() expects exactly 1 parameter, 0 given
Filename: mx_select_plus/ft.mx_select_plus.php
Line Number: 608
...

A Database Error Occurred
Error Number: 1054

Unknown column 'Array' in 'field list'
INSERT INTO `exp_matrix_data` (`col_id_10`, `col_id_11`, `col_id_48`, `col_id_12`, `col_id_13`, `col_id_14`, `row_order`, `site_id`, `field_id`, `entry_id`, `is_draft`) VALUES ('Example', 'img-example.png', Array, 'example text here', 'http://exampleurl.com/', 'exampleurl.com', 166, '1', '46', '15', 0)

Filename: third_party/matrix/ft.matrix.php
Line Number: 2659

Matrix field layout:

I'm running ee v2.10.1 with the latest version of matrix and mx select plus.

Any pointers?

Ivanovarde commented 8 years ago

I know it is a little late for this answer, but perhaps this could be useful for someone else.

To solve this issue, in the script named "ft.mx_select_plus.php" (expressionengine/third_party/mx_select_plus/ft.mx_select_plus.php)

Go to line 608:

change this: $data = ( is_array() ) ? implode( '|', $data ) : $data;

to this: $data = ( is_array($data) ) ? implode( '|', $data ) : $data;

Notice the $data inside the is_array() function

That should solve the issue