0
Welcome Guest! Login
0 items Join Now

PHP 7.2 fix for RokCommon

    • Kat05's Avatar
    • Kat05
    • Preeminent Rocketeer
    • Posts: 25898
    • Thanks: 332

    PHP 7.2 fix for RokCommon

    Posted 1 year 6 months ago
    • Hi there,

      if you are using RokCommon on your site which is required for both RokSprocket and RokGallery to work and if your server is running PHP 7.2.x, you may have come across the following:

      Using Joomla:
      PHP Deprecated: Function create_function() is deprecated in ../libraries/rokcommon/RokCommon/Service/ContainerImpl.php on line 460
      PHP Deprecated: Function create_function() is deprecated in ../libraries/rokcommon/RokCommon/Service/ContainerImpl.php on line 461

      Using WordPress:
      PHP Deprecated: Function create_function() is deprecated in ../wp-content/plugins/wp_rokcommon/RokCommon/Service/ContainerImpl.php on line 460
      PHP Deprecated: Function create_function() is deprecated in ../wp-content/plugins/wp_rokcommon/RokCommon/Service/ContainerImpl.php on line 461

      to get rid of these error notices, please open the file ContainerImpl.php and find the lines 460 and 461:
      $id = preg_replace_callback('/(^|_|-)+(.)/', create_function ('$matches', 'return strtoupper($matches[2]);'), $id);
      $id =  preg_replace_callback('/\.(.)/', create_function ('$matches', 'return "_".strtoupper($matches[1]);'), $id);
      and replace them with the lines below:
      $id = preg_replace_callback('/(^|_|-)+(.)/', function ($matches) { return strtoupper($matches[2]); }, $id);
      $id =  preg_replace_callback('/\.(.)/', function ($matches) { return "_".strtoupper($matches[1]); }, $id);
      The mentioned change will be avaible soon in the upcoming update releases for RokCommon/RokGallery/RokSprocket.
    • The following users have thanked you: Henning, Fernando H Uribe, MrT, Jean-Pierre d'Argent, Joep van Stratum, Justin Jahns, Luis Daniel Lucio Quiroz, Tim Sorenson

    • Kat05 / QA Lead & Support / Germany
    • Steve_bcs's Avatar
    • Steve_bcs
    • Jr. Rocketeer
    • Posts: 20
    • Thanks: 0

    Re: PHP 7.2 fix for RokCommon

    Posted 1 year 3 months ago
    • Hello,
      I've tried to modify the lines as indicated but now get this error:

      Error: [] operator not supported for strings: [] operator not supported for strings
    • Damir's Avatar
    • Damir
    • Preeminent Rocketeer
    • Posts: 22400
    • Thanks: 2663
    • Web Developer

    Re: PHP 7.2 fix for RokCommon

    Posted 1 year 3 months ago
  • Re: PHP 7.2 fix for RokCommon

    Posted 1 year 3 months ago
    • Hello, I changed thos lines of code and nothing happens. I still get a blank page with an error single word on it. on the error log I sill get: Deprecated: Function create_function() is deprecated in /home/xxx/public_html/web/libraries/rokcommon/RokCommon/Service/ContainerImpl.php on line 460

      today all my sites running on joomla with rockettheme RokCommon / roksprocket are giving me errors due to the php upgrade that my hosting provider did yesterday. Any advice on what to do please?
    • Damir's Avatar
    • Damir
    • Preeminent Rocketeer
    • Posts: 22400
    • Thanks: 2663
    • Web Developer

    Re: PHP 7.2 fix for RokCommon

    Posted 1 year 3 months ago
    • Doriandr wrote:
      Hello, I changed thos lines of code and nothing happens. I still get a blank page with an error single word on it. on the error log I sill get: Deprecated: Function create_function() is deprecated in /home/xxx/public_html/web/libraries/rokcommon/RokCommon/Service/ContainerImpl.php on line 460

      today all my sites running on joomla with rockettheme RokCommon / roksprocket are giving me errors due to the php upgrade that my hosting provider did yesterday. Any advice on what to do please?

      Please post your URL, Username and Password in Secure Tab and i will take a look and maybe figure out what the problem is.

      FTP info with Username and password is also necessary ...

      For posting sensitive information you hit the Blue Reply Button and then you will see Secure Tab. Post all info that is sensitive in there, only Fellow Mods, Staff and I can see that!
    • Available for CUSTOM WORK with Joomla, WordPress and Grav Templates and Gantry Framework!
    • marqus79's Avatar
    • marqus79
    • Sr. Rocketeer
    • Posts: 150
    • Thanks: 0

    Re: PHP 7.2 fix for RokCommon

    Posted 1 year 2 months ago
    • I am seeing the same error after this fix --- did you figure this out? @Steve_bcs
    • Last Edit: 1 year 2 months ago by marqus79.
    • Damir's Avatar
    • Damir
    • Preeminent Rocketeer
    • Posts: 22400
    • Thanks: 2663
    • Web Developer

    Re: PHP 7.2 fix for RokCommon

    Posted 1 year 2 months ago
    • marqus79's Avatar
    • marqus79
    • Sr. Rocketeer
    • Posts: 150
    • Thanks: 0

    Re: SOLVED PHP 7.2 fix for RokCommon

    Posted 1 year 2 months ago
    • @DAMIR and all who performed the following updates and then received an "Error: [] operator not supported for strings: [] operator not supported for strings" as noted by previous posts. The following RT post really helped!::

      rockettheme.com/forum/gantry-for-joomla/...-t-work-with-php-7-1

      It turns out that the LAYOUT.PHP fix helped fix the ERROR, as well as helping find other extentions that were deprecated / outdated and did not show up in ERROR REPORTING.

      I hope this fix, helps others get on the right track!
    • Last Edit: 1 year 2 months ago by marqus79.
    • Damir's Avatar
    • Damir
    • Preeminent Rocketeer
    • Posts: 22400
    • Thanks: 2663
    • Web Developer

    Re: SOLVED PHP 7.2 fix for RokCommon

    Posted 1 year 2 months ago
    • assur3's Avatar
    • assur3
    • Elite Rocketeer
    • Posts: 519
    • Thanks: 0

    Re: PHP 7.2 fix for RokCommon

    Posted 7 months 13 hours ago
    • Hi Everyone,

      I found this thread hoping to find the answer to my issue. i upgraded my PHP to the latest 7.2. ended up coming with error messege on ROKCommon. i grabed the latest on ROKCommon and installed it. However this did fix the issue where ROKCommon is deprecated.

      Noted the lines that were said to be an issue in the thread but, they are diffrent from what I have.


      Warning: Attempt to modify property of non-object in /home4/assur3/public_html/libraries/rokcommon/RokCommon/Registry.php on line 369
      Warning: Attempt to modify property of non-object in /home4/assur3/public_html/libraries/rokcommon/RokCommon/Registry.php on line 363

      Anyway to fix this? my site is down untill then..

      Thanks!

Time to create page: 0.083 seconds