This topic has 14 replies, 3 voices, and was last updated 9 years by 5high-photohub.
-
Author
Tagged: php errors, invalid, argument, shortcodes, kleo, js composer
-
June 23, 2015 at 06:29 #644165high-photohubParticipant
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.
June 23, 2015 at 16:43 #64500sharmstrModeratorwhat 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 solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
June 24, 2015 at 02:36 #646385high-photohubParticipantyes, 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…
June 24, 2015 at 02:50 #646405high-photohubParticipantAlso the lines of code that’s repeatedly listed in the errors are these:
line #474 = ‘foreach…’:COPY CODEpublic 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 CODEprotected 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.
June 24, 2015 at 04:57 #64652sharmstrModeratorHonestly, 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 solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
June 24, 2015 at 05:03 #64654sharmstrModeratorForgot 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 solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
June 24, 2015 at 05:03 #646555high-photohubParticipantOK, I’ll ask @sedmorders to post his ‘fix’ in a way others can follow, and will update with the outcome here.
Thanks.June 24, 2015 at 05:19 #646565high-photohubParticipant@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.
June 24, 2015 at 05:20 #64657sharmstrModeratorWell, 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 solutionThis 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.June 24, 2015 at 05:23 #646595high-photohubParticipantThanks – 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 🙂
June 24, 2015 at 20:27 #64744sharmstrModeratorI’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 solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
June 24, 2015 at 20:28 #64745sharmstrModeratorbtw – 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 solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
June 25, 2015 at 17:44 #64902AbeKeymastersubmitted 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. -
AuthorPosts
The topic ‘endless php errors for js composer since last update’ is closed to new replies.