Application broken after upgrading from v4.03 to v4.0.4 |
Well i just upgrade from 4.0.3 to latest released 4.0.4 and my Filter class broken.
It is not easy to replicate the problem.
Can you please copy and paste details of the error and enclose the script inside Quote: // Error messages go hereor preferably PHP Code: // script goes here (07-15-2020, 11:17 PM)John_Betong Wrote: It is not easy to replicate the problem. Fixed! Buth codeigniter should put a proper upgrade guild next time. Fixed solution here. in version 4.0.3 we declare our filter before function by using. PHP Code: public function before(RequestInterface $request) But in version 4.0.4 i need to add $arguments = null to the param PHP Code: public function before(RequestInterface $request, $arguments = null)
It was in the change log:
Added $arguments parameter to after() and before() in FilterInterface. This is a breaking change, so all code implementing the FilterInterface must be updated What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
(07-16-2020, 02:13 AM)InsiteFX Wrote: It was in the change log: In the update the following error occurred: Fatal error: Uncaught Error: Call to undefined function CodeIgniter \ locale_set_default () in C: \ wwwroot \ system \ CodeIgniter.php: 184 Stack trace: # 0 C: \ wwwroot \ system \ bootstrap.php (181): CodeIgniter \ CodeIgniter -> initialize () # 1 C: \ wwwroot \ index.php (36): require ('C: \\ wwwroot \\ syst ...') # 2 {main} thrown in C: \ wwwroot \ system \ CodeIgniter .php online 184 The line was commented and the problem solved: //locale_set_default ($ this-> config-> defaultLocale ?? 'en'); (07-16-2020, 04:45 AM)born2webdesign Wrote:As the author of this fix I'd like to chime in with a question to this:(07-16-2020, 02:13 AM)InsiteFX Wrote: This is a breaking change My first attempt of fixing this was by adding an additional interface FilterInterfaceWithArguments since I didn't like the idea of messing with interfaces and breaking existing code. Adding a new interface had the pros of not breaking existing code, but the cons of adding complexity to the framework with basically this interfaces for the same thing, but one interface working as described in the docs. By fixing the bug this way the framework was kept clean and the bug was fixed. So, my question: since SemVer §8 states that "Major version X (X.y.z | X > 0) MUST be incremented if any backwards incompatible changes are introduced to the public API." should the fix either have been a) a new interface or b) a release of CI 5.0.0? As a side note I'd like to see the re-introduction of the minor upgrade docs from CI3. /Mattias
(07-16-2020, 06:26 AM)wdeda Wrote:(07-16-2020, 02:13 AM)InsiteFX Wrote: It was in the change log: You should have the PHP intl extension installed in your machine. |
Welcome Guest, Not a member yet? Register Sign In |