-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Fix Configuration change has no effect #21943 #21949
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
This in effect cache busts the file every time the configuration is loaded (so on every request). Seems like the cache bust should happen when the global config is saved. |
|
Also here please fill out the template so we know hwy you do this and how to test and please fix the phpcs issue reported on drone: As well as add a clean line before the actual include. |
I only need opcache_invalidate function to solve issue joomla#21943
Did you miss this comment ? by @mbabker J3.9 triggers events for Global configuration save (before and after)
So against the branch 3.9-dev branch you could test / try using the code that you have already suggested here, /**
* On Saving application configuration logging method
* Method is called when the application config is being saved
*
* @param JRegistry $config JRegistry object with the new config
*
* @return void
*
* @since 3.9.0
*/
public function onApplicationAfterSave($config)
{
if (function_exists('opcache_invalidate'))
{
opcache_invalidate(............................);
}
} |
|
The code should go in joomla-cms/administrator/components/com_config/model/application.php Lines 457 to 460 in 54de782
|
|
When I change and save global configuration, configuration file is correctly modified (it contains the new editor), but the configuration file was not reloaded with the new configuration (cache was not updated). |
| { | ||
| throw new RuntimeException(JText::_('COM_CONFIG_ERROR_WRITE_FAILED')); | ||
| } | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove tabs on line 461.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
|
I have tested this item ✅ successfully on c899ab1 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/21949. |
|
Please, could anyone else test this, I need this fix. |
|
I suggest updating testing instructions to indicate that this can be reproduced when |
In my php.ini file, |
|
Cloud access.net server has now the same cached behavior. |
|
I have tested this item ✅ successfully on c899ab1 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/21949. |
|
RTC This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/21949. |
|
Hi, I'm using native Joomla caching and JCH Optimize Pro plugin which minimize the javascript and html files. I will deactivate it and see if there will be some changes. |
* Fix Editor change does not work #21943 * Update Factory.php * omit caching functions I only need opcache_invalidate function to solve issue #21943 * Invalidates the cached configuration file #21949 (comment) * Invalidates cached file after write #21949 (comment) * Update application.php * Fix issue #24649 * Format trackdate to SQL. * Format trackdate in 2 steps. See #24651 (comment) Co-authored-by: Quy <[email protected]> Co-authored-by: Tobias Zulauf <[email protected]> Co-authored-by: Allon Moritz <[email protected]>
Pull Request for Issue #21943 .
Summary of Changes
Adds the opcache_invalidate function before loading the configuration file.
opcache_invalidate : invalidates the cached file if the modification time of the file is newer than the cached opcodes.
Testing Instructions
OR
Create a site on your localhost with these server settings.
Edit the php.ini file and set the opcache.revalidate_freq value to 60 in the opcache section :
[opcache]
zend_extension=php_opcache.dll
opcache.enable=1
opcache.enable_cli=0
opcache.memory_consumption=128
opcache.interned_strings_buffer=8
opcache.max_accelerated_files=10000
opcache.revalidate_freq=60
opcache.fast_shutdown=1
This is my default configuration (bitnami wappstack server).
Restart Apache service.
Expected result
The settings in Global configuration are saved and taken into account.
Actual result
The new global configuration is not taken into account each time I save it (if patch is not applied).