Okay
  Public Ticket #1301916
Illegal string offset 'Theme Color'
Closed

Comments

  • bennyuk started the conversation

    I'm getting error message on every page with AVEN. I've worked out its linked to visual composer and aven theme trying to add custom colours. I think it is a php 7.1 related bug.

    wp 4.8.1

    php7.19

    on line 66 of aven/includes/visual-composer/visual-composer.php it had a function to allow custom colours to be added.

    This is giving the following error

    13012#0: *1289609 FastCGI sent in stderr: "PHP message: PHP Warning: Illegal string offset 'Theme Color' in /var/www/vhosts/.../includes/visual-composer/visual-composer.php on line 66" while reading response header from upstream

    I have removed the code and the error has gone. code rmoved was:-

    add_action( 'vc_after_init', 'aven_zozo_add_new_color_options' );

    function aven_zozo_add_new_color_options() {
      //Get current values stored in the param
      $param = WPBMap::getParam( 'vc_masonry_grid', 'button_color' );
      //Append new value to the 'value' array
      $param['value'][esc_html__( 'Theme ColorX', 'aven' )] = 'primary-bg';
      //Finally "mutate" param with new values
      vc_update_shortcode_param( 'vc_masonry_grid', $param );
    }

    Is there an updae to get this working in php7?



  •  210
    ZOZO replied

    Sure i will update code what u removed, as it was not working .....  which code u removed friend?

  • bennyuk replied

    on line 66 of aven/includes/visual-composer/visual-composer.php it had a function to allow custom colours to be added.

    code removed was

    function aven_zozo_add_new_color_options() {
      //Get current values stored in the param
      $param = WPBMap::getParam( 'vc_masonry_grid', 'button_color' );
      //Append new value to the 'value' array
      $param['value'][esc_html__( 'Theme Color', 'aven' )] = 'primary-bg';
      //Finally "mutate" param with new values
      vc_update_shortcode_param( 'vc_masonry_grid', $param );
    }


  •  210