Chosen, Select2 or Selectize Plugins with Multiple enabled

Chosen, Select2 or Selectize Plugins with Multiple enabled

Restful Web ServicesRestful Web Services Posts: 202Questions: 49Answers: 2
edited December 2015 in Editor

I have attempted to use the Chosen, Select2 & Selectize plugins on my standard select to add a little functionality. Whenever the attribute/option 'multiple' is selected then I cannot save the data. I just receive the following error in my console:

<b>Warning</b>: explode() expects parameter 2 to be string, array given in <b>/public_html/uploads/js/datatables/php/lib/Vendor/htmLawed/htmLawed.php</b> on line <b>181</b><br />

It is the same error which ever plugin I try.

Is there really an error in that file or is it something at my end?

Thanks

Chris

Replies

  • allanallan Posts: 61,761Questions: 1Answers: 10,111 Site admin

    Hi Chris,

    That's a bug I'm afraid.

    In the Field.php file you'll find a function called xssSafety replace it completely with:

        public function xssSafety ( $val ) {
            $xss = $this->_xss;
    
            if ( is_array( $val ) ) {
                $res = array();
    
                foreach ( $val as $individual ) {
                    $res[] = $xss ?
                        $xss( $individual ) :
                        DataTables\Vendor\Htmlaw::filter( $individual );
                }
    
                return $res;
            }
    
            return $xss ?
                $xss( $val ) :
                DataTables\Vendor\Htmlaw::filter( $val );
        }
    

    That will address the issue.

    Thanks for letting me know about this. The fix will be in the next release of Editor.

    Regards,
    Allan

This discussion has been closed.