You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Which operating systems have you tested for this bug?
macOS, Linux
Which server did you use?
fpm-fcgi
Database
No response
What happened?
After change #8977 overriding filter arguments is no longer working.
Before I could do:
// Config/Routes.php$routes->group('authentication', ['filter' => 'portal:public'], function ($routes) { // Pass argument 'public' to portal filter$routes->addRedirect('/', 'authentication/login');
});
// Config/Filters.phppublic array $globals = [
'before' => ['portal'], // Before 4.6.0, this filter would get overridden by the filter in Routes.php'after' => [
'secureheaders' => [],
'toolbar' => [],
],
];
After the change in 4.6.0, the filter is called twice: once without the argument and once with the argument 'public'. If this is intentional, what should I do to get the old behavior back? I am using the old filter order ($oldFilterOrder = true), in case that matters.
Steps to Reproduce
Use the same filter in Routes.php and within globals in Filters.php, but use different arguments in both cases.
Expected Output
Arguments from globals are used when $oldFilterOrder is set to false. The value from routes is used when $oldFilterOrder is true. However, since version 4.6.0, the filters are executed twice, each with their own arguments.
Anything else?
No response
The text was updated successfully, but these errors were encountered:
NSURLSession0
added
the
bug
Verified issues on the current code behavior or pull requests that will fix them
label
Jan 19, 2025
NSURLSession0
changed the title
Bug: Overriding Filters no longer working in v4.6.0
Bug: Overriding Filters / Filter arguments no longer working in v4.6.0
Jan 19, 2025
michalsn
removed
the
bug
Verified issues on the current code behavior or pull requests that will fix them
label
Jan 19, 2025
paulbalandan
changed the title
Bug: Overriding Filters / Filter arguments no longer working in v4.6.0
Overriding Filters / Filter arguments no longer working in v4.6.0
Jan 20, 2025
PHP Version
8.1
CodeIgniter4 Version
4.6.0
CodeIgniter4 Installation Method
Composer (using
codeigniter4/appstarter
)Which operating systems have you tested for this bug?
macOS, Linux
Which server did you use?
fpm-fcgi
Database
No response
What happened?
After change #8977 overriding filter arguments is no longer working.
Before I could do:
After the change in 4.6.0, the filter is called twice: once without the argument and once with the argument 'public'. If this is intentional, what should I do to get the old behavior back? I am using the old filter order ($oldFilterOrder = true), in case that matters.
Steps to Reproduce
Use the same filter in Routes.php and within globals in Filters.php, but use different arguments in both cases.
Expected Output
Arguments from globals are used when $oldFilterOrder is set to false. The value from routes is used when $oldFilterOrder is true. However, since version 4.6.0, the filters are executed twice, each with their own arguments.
Anything else?
No response
The text was updated successfully, but these errors were encountered: