This topic has 14 replies, 3 voices, and was last updated 9 years by 5high-photohub.

  • Author
  • #64416
     5high-photohub
    Participant

    Hi,

    Since updating the Kleo theme and its attendant plugins I’m getting endless php errors like this:
    PHP Warning: Invalid argument supplied for foreach() in /home/mysite/public_html/wp-content/plugins/js_composer/include/classes/shortcodes/shortcodes.php on line 1005
    and on line 474 too.

    I thought it might be the js-composer that needed updating, but it shows it all up to date. I’m on Kleo 3.0.0 and js-composer 4.5.2.

    Any ideas? i did find another thread about the same errors but they somehow changed the php version to fix it – no idea what that was about!

    Thanks.

    #64417
     5high-photohub
    Participant

    ps: on Kleo 3.0.1

    #64500
     sharmstr
    Moderator

    what version of php did they change to? can you link that info?

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #64638
     5high-photohub
    Participant

    yes, the link is here: https://archived.seventhqueen.com/forums/topic/kleo-3-0-visual-composer-4-5-2-wont-edit-any-pages and although the php error is the same (well one of them is) editing with jc composer is OK for me. So it might be a total red herring…

    #64640
     5high-photohub
    Participant

    Also the lines of code that’s repeatedly listed in the errors are these:
    line #474 = ‘foreach…’:

    COPY CODE
    public function contentAdmin( $atts, $content ) {
    			$element = $this->shortcode;
    			$output = $custom_markup = $width = $el_position = '';
    
    			if ( $content != null ) {
    				$content = wpautop( stripslashes( $content ) );
    			}
    			$shortcode_attributes = array( 'width' => '1/1' );
    			foreach ( $this->settings['params'] as $param ) {
    				if ( $param['param_name'] != 'content' ) {
    					if ( isset( $param['value'] ) ) {
    						$shortcode_attributes[ $param['param_name'] ] = is_string( $param['value'] ) ? __( $param['value'], "js_composer" ) : $param['value'];
    					} else {
    						$shortcode_attributes[ $param['param_name'] ] = '';
    					}
    				} else if ( $param['param_name'] == 'content' && $content == null ) {
    					$content = isset( $param['value'] ) ? __( $param['value'], "js_composer" ) : '';
    				}
    			}

    and line # 1005 = ‘foreach…’:

    COPY CODE
    protected function paramsHtmlHolders( $atts ) {
    			extract( $atts );
    			$iner = '';
    			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 = is_null( $first_key ) ? '' : $param_value[ $first_key ];
    				}
    				$iner .= $this->singleParamHtmlHolder( $param, $param_value );
    			}

    Thanks for looking into this.

    #64652
     sharmstr
    Moderator

    Honestly, the warnings dont matter. They dont slow down the site. They just fill up the log. But it appears, based on that other thread, that if you want to make them go away, you need to change your php version. You should be able to do that within cpanel of your hosting account. They are happening on my site, but I dont care. I’d rather run a newer version of PHP.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #64654
     sharmstr
    Moderator

    Forgot to mention – we’ll be contacting VC about this.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #64655
     5high-photohub
    Participant

    OK, I’ll ask @sedmorders to post his ‘fix’ in a way others can follow, and will update with the outcome here.
    Thanks.

    #64656
     5high-photohub
    Participant

    @sharmstr – I’ve also found a thread about this exact same error – see info in the VC support forum 20 days ago by ‘graciliano’ here: http://codecanyon.net/item/visual-composer-page-builder-for-wordpress/242431/comments?page=424. They reckoned a conflict with WooCommerce, though i don’t have that on this site as yet.

    Also here (http://themeforest.net/item/organic-food-responsive-wordpress-theme/9190826/comments) about 9 days ago under ‘ideiaznet’.

    So it sounds like a problem with jc-composer with something else – can you put in a support ticket with them for this? After all, getting endless php errors does mean there’s a problem, even if it’s a minor one!

    Many thanks.

    #64657
     sharmstr
    Moderator

    Well, its going to be different depending on the hosting company you use. As I mentioned, you need to log into your hosting cpanel (or similar) and change your php version. But you need to be careful that it doesnt cause other issues with other plugins.

    Attached is how I would do it on Siteground hosting.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    Attachments:
    You must be logged in to view attached files.
    #64659
     5high-photohub
    Participant

    Thanks – I think our comments crossed paths just now! re. changing php versions, not sure i can do that on mine, and as you said it might effect other things. Will await for a solution from VC 🙂

    #64744
     sharmstr
    Moderator

    I’ve done some testing and it logs the errors when you bring up a page in the backend. It only does this when either woo or k-elements is active. k-elements throws 1 set of errors. woo throws 4 sets of errors.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #64745
     sharmstr
    Moderator

    btw – that response was for abe, not 5high-photohub

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #64902
     Abe
    Keymaster

    submitted this to VC team and waiting for a fix from them. You shouldn’t be worried by that since it is php notice and no actual error happens there

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    ---
    @ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.

    #64980
     5high-photohub
    Participant

    Thanks Abe and sharmstr.

Viewing 15 posts - 1 through 15 (of 15 total)

The topic ‘endless php errors for js composer since last update’ is closed to new replies.

Log in with your credentials

Forgot your details?