Deprecation Error with Wiredesign's HMVC extension on PHP 7.2 |
Just until yesterday and until i had upgraded to php 7.2 i got this error saying thIs
PHP Code: <div style="border:1px solid #990000;padding-left:20px;margin:0 0 10px 0;"> system info: php7.2 on ubuntu 17.10 lamp stack
You've done nothing wrong, except you haven't really put thought into this before posting about it.
each() is deprecated in PHP 7.2 and the extension you're using uses the function - that's all there's to be said about it.
This is not TESTED!
But you can try it, if not it will be a start to fixing the depreciated each() function. Change line 83 or 84 - in third_party/MX/Modules.php - PHP Code: (is_array($module)) ? list($module, $params) = each($module) : $params = NULL; Add this code and see if it will fix the problem for you. PHP Code: if (is_array($module)) Remember this is not TESTED... What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
(12-06-2017, 06:16 AM)InsiteFX Wrote: This is not TESTED! Thanks for your help and i appreciate it. However i tried it and it seems that the list function needs to be assigned to some variable. i got this error by the way... Code: Type: ParseError
12-06-2017, 08:36 AM
(This post was last modified: 02-09-2018, 05:15 AM by InsiteFX. Edit Reason: Added the missing $this-> )
Alright, here is another one you can try, again not TESTED.
PHP Code: (is_array($module)) ? list($module, $params) = $this->makeEach($module) : $params = NULL; Add that new method to the bottom of the Module file. What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
(12-06-2017, 08:36 AM)InsiteFX Wrote: Alright, here is another one you can try, again not TESTED.Okay so that worked but i had to do some few changes to your code. i made the function you asked me to place at the bottom a static function and called it in that line using Self::makeEach so i ended up having something like this PHP Code: (is_array($module)) ? list($module, $params) = Self::makeEach($module) : $params = NULL; And that did it... Thanks InsiteFX
Right I just noticed that I left off the $this->
Anyways glad you got it to work I' am sure it will bite some of the other users. What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
I found a patch in my code about this deprecation. Probably it is based on a snippet I've seen before, but I don't remember from where it has been taken.
Code: // Modified by Ivan Tcholakov, 21-JAN-2017. |
Welcome Guest, Not a member yet? Register Sign In |