Okay
  Public Ticket #171141
Visual Composer will throw a PHP Error with new versions of PHP
Closed

Comments

  • Paul started the conversation

    With newer versions of PHP (like the one WPEngine uses), the Visual Composer will throw an error (see attached). It also won't let you move Elements between Rows.

    The PHP log file is below (with the domain name omitted):

    [Thu Feb 27 22:50:52 2014] [error] [client 97.83.58.37] PHP Warning: usort() [function.usort]: Array was modified by the user comparison function in ……/wp-content/themes/salient/wpbakery/js_composer/composer/lib/mapper.php on line 110,

    --------

    You can see a link to the discussion on Stack Overflow -> http://stackoverflow.com/questions/3235387/usort-a... where people are having similar issues with their PHP applications.

  •  1,069
    ThemeNectar replied

    Hey Paul!

    Thanks for the heads up - I'll update the included Nectar VC as soon as WPBakery updates VC :)

    Cheers :)

  • Paul replied

    On StackOverflow they mention: 

    "The only workaround is to […] use the error suppression operator @usort() to ignore all errors."

    Could you tell me how to do that? I have a site that I'd like to put in production in the next 2 days.

  •  1,069
    ThemeNectar replied

    Just open up the file

    wp-content/themes/salient/wpbakery/js_composer/composer/lib/mapper.php

    and on line 110, edit this:

     
     usort(self::$user_sorted_sc, array("WPBMap", "sort"));
    

    to be this instead:

     
     @usort(self::$user_sorted_sc, array("WPBMap", "sort"));
    

    Cheers :)


  • Matt replied

    I had this problem too when migrating from BlueHost to WPEngine.  I error suppressed as suggested above, but VC still will not work correctly.  When you try to use the rich text editor in any element that you've added, the editor doesn't work.  Plain Text editing is the only way to edit the content.

    This is kind of a seriously broken issue.  

    For reference I was previously using BlueHost and the VC worked fine, they use PHP 5.4.  I found out from WPEngine that they use PHP 5.3.2.

  •  8,838
    Tahir replied

    Hey Matt!

    Could you try activating and deactivating the Theme Or perhaps taking a backup of the existing theme and installing the latest one ?. 

    Cheers


    ThemeNectar Support Team 

  • Matt replied

    I tried deactivating and reactivating, and uninstalling the theme and reinstalling it through FTP, to the same results.  The issue persists.  Attached are a couple of screenshots.  One of the error on the page editor, and then one of the rich text editor not working.  You can see on the text editor screen that the kitchen sink editor options are all missing.  The text area is not editable either.  You have to use plain text/html to edit.

  •  1,069
    ThemeNectar replied

    Het Matt, if you want to open a private ticket in regards I'll gladly log in and see if I can sort it for you :)

    Cheers