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 had modded a local-sample.css to local.css. Upon updating theme via update page, local.css was gone and local-sample.css was back. Is this behavior caused by core or by the theme? I posted to the theme issue queue and he said it was not the fault of the theme.
Comments
Comment #1
bfroehle CreditAttribution: bfroehle commentedI assume the theme in question is Danland.
The current behavior of update manager is to delete the entire theme or module directory before installing the new version. This is the only way we are able to ensure that files which are no longer distributed with the theme or module are removed.
Perhaps we can improve by adding a warning that any local customizations to a theme will be overwritten.
Comment #2
Branjawn CreditAttribution: Branjawn commentedAre you psychic?? Yes, I am using Danland. And yes, a warning would be great! Luckily I only had about 10 lines of custom css and I remembered them all.
How hard would it be to leave local.css alone since that is becoming established protocol in place of subtheming.
Comment #3
bfroehle CreditAttribution: bfroehle commentedNot psychic -- see http://drupal.org/user/406556/track
We'll consider this addition. For the moment, be sure to always back up your theme before updates.
Comment #4
bfroehle CreditAttribution: bfroehle commentedComment #5
Branjawn CreditAttribution: Branjawn commentedThanks Bradley!
Comment #6
dwwYeah, this is "by design". Unfortunately, adding a warning means breaking all the core translations (or at least that the warning won't be available in other languages until those translations are updated). And certainly anything smart like a new feature trying to preserve locally modified files isn't going to be allowed in a stable release. So, I think this is going to have to be D8 material at this point...
Comment #7
caschbre CreditAttribution: caschbre commentedI'm wondering if a D7 option would be to allow for themes/modules to identify files (in the .info file??) that should not be updated with the update manager. This would at least give themes the ability to not have local.css updated.
Comment #8
bfroehle CreditAttribution: bfroehle commentedFor the time being, a sub-theme type mechanism like Zen or AdaptiveTheme, is really the best way to keep local customizations (short of doing everything in version control and merging in upstream changes).
Comment #9
bfroehle CreditAttribution: bfroehle commentedAlso, I believe Drush can be set up to take backups of themes and modules before upgrading them --- their mechanism for doing this might be worth investigating as well.
Comment #10
Branjawn CreditAttribution: Branjawn commentedI just want to say I appreciate everyone's consideration. My local DUG post was not as kindly accepted. It was more of "you're an idiot for doing that".
Comment #11
bfroehle CreditAttribution: bfroehle commentedThe near term solution might be to put a warning in the update manager that "All local file modifications will be overwritten." or similar.
Comment #12
jhedstromI'm inclined to mark this "won't fix". There are well-supported mechanisms for patching core (eg, Drush make, Composer). Hacking core (eg, w/o documentation or a patch) has never been supported.
Comment #28
smustgrave CreditAttribution: smustgrave at Mobomo commentedClosing as outdated. If still a valid feature request please reopen updating the issue summary per #12
Thanks!