While processing a request (e.g. on a controller), if after some change on the framework (e.g. change language programatically) you need to refresh plugins language you can call "onAfterInitiliaze" event.
This will trigger languagefilter plugin also to ack the new language.
languagefilter works with new language.
languagefilter indeed works with new language but has "doubled" rules attached to the router.
This results in having 2 time "/en" language tag on sef urls.
Setting Value
PHP Built On Linux c19785.sgvps.net 6.6.21-MCIclouder470 #470 SMP PREEMPT_DYNAMIC Fri Mar 8 08:09:36 EET 2024 x86_64
Database Type mysql
Database Version 8.0.36-28
Database Collation utf8mb4_general_ci
Database Connection Collation utf8mb4_0900_ai_ci
Database Connection Encryption None
Database Server Supports Connection Encryption Yes
PHP Version 8.2.23
Web Server Apache
WebServer to PHP Interface cgi-fcgi
Joomla! Version Joomla! 4.4.8 Stable [ Pamoja ] 27-August-2024 16:00 GMT
User Agent Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36
Related function:
public function attachBuildRule(callable $callback, $stage = self::PROCESS_DURING)
{
if (!\array_key_exists('build' . $stage, $this->rules)) {
throw new \InvalidArgumentException(sprintf('The %s stage is not registered. (%s)', $stage, METHOD));
}
$this->rules['build' . $stage][] = $callback;
}
Suggesting to "check if rule exists already, remove it and then re-apply it"
Labels |
Removed:
?
|
Labels |
Added:
No Code Attached Yet
|
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2024-09-19 12:06:01 |
Closed_By | ⇒ | Hackwar |
The event
onAfterInitialise
can only be called once and can not be triggered a second time. This is also the case if you even only call the languagefilter plugins method. Whatever you are trying to do, this is not the way to go. This is not a bug in Joomla, thus closing this issue.