Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I've notices that, once in a while, the "Rescan template files" button (introduced here, by me) doesn't seem to work: the list of template files doesn't get refreshed. I've tracked down the bug: theme_get_registry() uses an internal cache that needs to be cleared.
I'm attaching a patch.
Comment | File | Size | Author |
---|---|---|---|
rescan.diff | 1 KB | mooffie | |
Comments
Comment #1
mooffie CreditAttribution: mooffie commentedNow for a fine moment of trivia:
I explained in the inline comment that theme_get_registry()'s cache is initialized before Drupal executes our submit handler. This happens because when Drupal builds this specific form it initializes the theme system. And *this* happens because there are 'markup' elements in the form that call various theme functions ('item_list' in our case).
Comment #2
merlinofchaos CreditAttribution: merlinofchaos commentedNice work!
Comment #3
Anonymous (not verified) CreditAttribution: Anonymous commentedAutomatically closed -- issue fixed for two weeks with no activity.