No need to explicitly clear CSS and JS
kbahey - October 25, 2008 - 02:40
| Project: | Drupal |
| Version: | 7.x-dev |
| Component: | system.module |
| Category: | bug report |
| Priority: | critical |
| Assigned: | Unassigned |
| Status: | closed |
Description
When clicking on the button that clears the caches in admin/settings/performance, there are two explicit submits for CSS and JS.
This is not needed, since the #submit for that form called system_clear_cache_submit(), which in turn calls drupal_flush_all_caches(), which has inside it the calls to clear JS and CSS.
So those two need to go.
This way, we save water, and be eco green and all that.
| Attachment | Size |
|---|---|
| no-added-flushing.patch | 636 bytes |
| Testbed results | ||
|---|---|---|
| no-added-flushing.patch | failed | Failed: Failed to apply patch. Detailed results |

#1
#2
The last submitted patch failed testing.
#3
See: #335122: Test clean HEAD after every commit and http://pastebin.ca/1258476
#4
Nice find, confirmed that hitting the button continues to clear CSS caches, RTBC.
#5
Committed to DRUPAL-6 and CVS HEAD. Thanks!
#6
Please revert.
The submit handler for system_performance_settings() is system_settings_form_submit(), so the explicit #submit calls to drupal_clear_css_cache and drupal_clear_js_cache *are* needed.
#7
Damz is right - while you can clear those caches by hitting the button, we /also/ need to clear them when saving the form. My fault for RTBC-ing too quickly.
#8
Fun! This was released in both 6.7 and 6.8...
#9
Bumping to critical, if you change the page compression settings, a mix of compressed and uncompressed pages will be stored in the cache_page table...
#10
Yeah that is a bad, bad condition to have. Marking as RTBC since all that is need is a rollback of the patch in the top post.
#11
Wait, no we need a new patch to clear the cache if settings are changed, not just when the clear cache button is clicked.
#12
Simple patch.
#13
@Dave: it has never been the case. Form-level submit handlers are not called when button-level handlers are defined.
This patch tried to fix an issue that doesn't exist.
#12 is RTBC. Please commit on both D7 and D6.
#14
Committed to CVS HEAD and DRUPAL-6. Thanks!
#15
Did this get rolled back? Does it need a status update? http://drupal.org/cvs?commit=162924
#16
Automatically closed -- issue fixed for two weeks with no activity.