New Landing How can we help? Cardinal Warning swift-framework: icon box

Viewing 6 posts - 1 through 6 (of 6 total)
  • Posted in: Cardinal
  • #260338
    Karenborgers
    Member
    Post count: 33

    Dear support team,

    When I add a icon box and try to edit it, I get this warning:

    Warning: Invalid argument supplied for foreach() in /var/www/vh4670/1/bekendmakers.nl/wp-content/themes/cardinal/swift-framework/core/sf-functions.php on line 2107

    I have already deleted swift-framework with FTP. And reinstalled the plugin by uploading an older version. After updating that to the newest, the error was still there.

    Thank you in advance for helping me out!

    Attachments:
    You must be logged in to view attached files.
    #260347
    Rui Guerreiro – SUPPORT
    Keymaster
    Post count: 25779

    Hi,

    Inside that file can you replace this code:

    foreach ( $fontello_icons as $icon){
                    	$fontello_list .= '<li><i class="icon-' . $icon . '"></i><span class="icon-name">' . $icon . '</span></li>';
                	}
    

    by this one

    
    if( !$fontello_icons ){
    
    				  $fontello_list = '';
    				  
    			else {
    
                	foreach ( $fontello_icons as $icon){
                    	$fontello_list .= '<li><i class="icon-' . $icon . '"></i><span class="icon-name">' . $icon . '</span></li>';
                	}
    
                }

    Let us know if it worked, we will fix this for the next update.

    -Rui

    #260714
    Karenborgers
    Member
    Post count: 33

    Doesn’t work, now I got this error (printscreen) and can’t log in to the website.
    I have set the code back.

    Attachments:
    You must be logged in to view attached files.
    #260717
    David Martin – Support
    Moderator
    Post count: 20834

    @Karenborgers – there is a missing bracket before the else, try this:

    if( !$fontello_icons ){
     
       $fontello_list = '';
       
     } else {
     
                 foreach ( $fontello_icons as $icon){
                     $fontello_list .= '<li><i class="icon-' . $icon . '"></i><span class="icon-name">' . $icon . '</span></li>';
                 }
     
                }
    #260742
    Karenborgers
    Member
    Post count: 33

    Perfect! That works 🙂

    #260777
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    Great thanks to David.
    Mohammad

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

You must be logged in and have valid license to reply to this topic.

License required for one of the following items
Login and Registration Log in · Register