stanleyek18 Posted October 19, 2016 Share Posted October 19, 2016 (edited) Hello! After installing Visual Composer module for Prestashop 1.6.1.7 with PHP 7 I am getting this error: Notice w linii 74 w pliku l/public_html/modules/jscomposer/include/classes/shortcodes/vc-row.php [8] Array to string conversion The problem is with this line: $param_value = isset( $$param['param_name'] ) ? $$param['param_name'] : ''; I guess that is a PHP problem. What can be wrong with this particular line?Here is more from that file: if ( isset( $this->settings['params'] ) ) { $inner = ''; foreach ( $this->settings['params'] as $param ) { $param_value = isset( $$param['param_name'] ) ? $$param['param_name'] : ''; if ( is_array( $param_value ) ) { // Get first element from the array reset( $param_value ); $first_key = key( $param_value ); $param_value = $param_value[$first_key]; } $inner .= $this->singleParamHtmlHolder( $param, $param_value ); } $output .= $inner; Thanks for your help! Edited October 19, 2016 by stanleyek18 (see edit history) Link to comment Share on other sites More sharing options...
stanleyek18 Posted October 19, 2016 Author Share Posted October 19, 2016 (edited) Edited $param_value = isset( $$param['param_name'] ) ? $$param['param_name'] : ''; to $param_value = !empty($param['param_name'] ) ? $param['param_name'] : ''; and worked! Edited October 19, 2016 by stanleyek18 (see edit history) Link to comment Share on other sites More sharing options...
Pete78 Posted June 20, 2018 Share Posted June 20, 2018 Hi, if anybody is interested.. the better solution for php is: $param_value = !empty(${$param['param_name']} ) ? ${$param['param_name']} : ''; Because above solution will only erase the warning but actually will not put the right value into the var... also see: http://php.net/manual/de/migration70.incompatible.php#migration70.incompatible.variable-handling.indirect Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now