WPIntell

Source evidence

in_array() PHP error breaking admin select

Advanced Custom Fields: NextGEN Gallery Field add-on · support · 2014-02-28T21:51:00+00:00

complaintsentiment
highseverity
0.91relevance
0replies
Evidence linked to opportunitycommercial context

Proof Health

Open evidence

Commercial opportunities need traceable source links before they are treated as build-worthy.

5 / 31 rows with source links

16.1% of this page's analysis has direct source links.

0 build-decision rows missing links

0 rows here require auditable proof before promotion.

26 rows with no attached evidence

0 rows have source counts but still need direct links.

Conversation

support
PaulMighty unresolved
Ran into an issue with the select dropdown breaking when editing a page with a single gallery select configuration. Multi gallery select worked, just an issue with single gallery select set in the field group. An array is required when in_array is invoked to check if the current item in the loop matches a selected item, resulting in a broken select dropdown and this warning: Warning: in_array() expects parameter 2 to be array, string given in website.com/wp-content/plugins/advanced-custom-fields-nextgen-gallery-custom-field/nggallery-v4.php on line 183 Line number 183 might not be exact due to my testing, but below is what I ended up with that fixes the issue. In a nutshell, things only work out if $aSelectedGalleries is an array and not a string. // Get selected galleries $aSelectedGalleries = is_array( $field['value'] ) ? $field['value'] : array( $field['value'] ); Cheers and thanks for the great plugin! -PaulMighty https://wordpress.org/plugins/advanced-custom-fields-nextgen-gallery-field-add-on/

Comments

0 shown

No comments were stored for this source.