AT Commerce-theme updaten (Drupal)

Uit De Vliegende Brigade
Versie door Jeroen Strompf (overleg | bijdragen) op 7 aug 2018 om 11:22 (→‎Vanuit automatische backup)
(wijz) ← Oudere versie | Huidige versie (wijz) | Nieuwere versie → (wijz)
Naar navigatie springen Naar zoeken springen

Als ik het AT Commerce-theme update, raak ik instellingen kwijt en eindig ik meestal met een WSOD. Een voor-de-hand-liggende-oplossing, zoals werken met een child-theme, lijkt ook niet te voldoen.

Het probleem

Bij een update wordt de complete theme-map overschreven. Specifiek:

  • Het info-bestand wordt overschreven (daarin staat immers onderaan de versie van het theme)
  • De css-map wordt overschreven.

De oplossing: Bestanden terugzetten + refresh + versienummer aanpassen

In grote lijnen:

  • De betreffende bestanden handmatig terugzetten uit een backup
  • Refresh theme-registery
  • Versienummer onderaan .info-bestand aanpassen.

Vanuit automatische backup

Bij een update wordt er eerst een backup gemaakt, zoiets als

~/drush-backups/dev_example.com/20180806171733/themes/at_commerce

.info-bestand En de css-map terugzetten:

cd <naar backup-map>
cp at_commerce.info /var/www/example.com/sites/all/themes/at_commerce/
cp -r css/* /var/www/example.com/sites/all/themes/at_commerce/css

Vanuit backup-theme

Ik probeer een backup-theme-map aan te maken in dezelfde map als het echte theme, om bestanden uit te kunnen terugzetten. In theorie zou ik een storing kunnen krijgen omdat er nu twee .info-bestanden met dezelfde naam zijn. Toch tot op heden geen probleem mee gehad.

Casus zomer 2016

  • Na een update van een aangepast at_commerce-theme, ben ik veel van die instellingen kwijtgeraakt
  • Klonen van at_commerce naar een nieuwe naam, zodat deze niet wordt bijgewerkt, is geen optie: Die naam kun je niet zomaar wijzigen.
  • Voorlopige oplossing: fresh.css en .at_commerce.info terugzetten uit de backup die voorafgaand aan een update wordt gemaakt.

Casus nov. 2016 (1)

  • Storing: Theme is gereset naar standaard at_commerce-theme. Oa. is alle css gereset
  • Wat er is gebeurd: .info-bestand overschreven door standaardversie + fresh.css is verdwenen
  • Oorzaak: Blijkbaar wordt bij een update de complete map herschreven
  • Ik had de rechten vantevoren aangepast (chmod -R u-w *) zodat deze niet bij een update overschreven zouden worden. Lijkt niet te werken.

Casus nov. 2016 (2)

Zelfde als hiervoor. Ik dacht dat ik de rechten correct had aangepast, en drush up draaide niet met root-rechten.

Practische oplossing: In map /themes/all/at_commerce_bu staan de bestanden die teruggezet moeten worden, in de juiste submappen. Terugzetten gaat zo:

cd sites/themes/all/at_commerce_bu
cp -r * ..
drush cc all

Wat dat laatste betreft: Waarschijnlijk zijn er minder dramatische opties, bv. drush cc theme-registry, die eveneens werken.

LET OP: Deze methode werket niet goed: The theme registry gebruikt ook de bestanden die in deze backup-map staan. Dat maakt debuggen nogal lastig.

Casus nov. 2016 (3)

Het lijkt me dat ik het probleem zou kunnen verhelpen door de rechten op de bestanden aan te passen. Toch wil dat tot op heden niet lukken. Nu in detail:

drwx---r-x 4 strompf strompf 4,0K sep  3 17:34 ./
drwx---r-x 5 strompf strompf 4,0K jul  9 16:14 ../
drwx---r-x 5 strompf strompf 4,0K jul 26 18:08 adaptivetheme/
drwxr-xr-x 6 strompf strompf 4,0K sep  3 17:46 at_commerce/
-rwx---r-x 1 strompf strompf 1020 jul 22 20:03 README.txt*
-rwx---r-x 1 strompf strompf 664K jul 26 18:07 themes.zip*
strompf@dvb1:/var/www/example.com/sites/all/themes$ chmod -R ugo-w at_commerce/
strompf@dvb1:/var/www/example.com/sites/all/themes$ ll
total 684K
drwx---r-x 4 strompf strompf 4,0K sep  3 17:34 ./
drwx---r-x 5 strompf strompf 4,0K jul  9 16:14 ../
drwx---r-x 5 strompf strompf 4,0K jul 26 18:08 adaptivetheme/
dr-xr-xr-x 6 strompf strompf 4,0K sep  3 17:46 at_commerce/
-rwx---r-x 1 strompf strompf 1020 jul 22 20:03 README.txt*
-rwx---r-x 1 strompf strompf 664K jul 26 18:07 themes.zip*
strompf@dvb1:/var/www/example.com/sites/all/themes$ cd at_commerce && ll
dr-xr-xr-x 6 strompf strompf 4,0K sep  3 17:46 ./
drwx---r-x 4 strompf strompf 4,0K sep  3 17:34 ../
-r--r--r-- 1 strompf strompf  18K sep  3 17:46 at_commerce.info
dr-xr-xr-x 2 strompf strompf 4,0K jul 11 12:32 color/
dr-xr-xr-x 4 strompf strompf 4,0K sep 18 16:45 css/
-r-xr-xr-x 1 strompf strompf 1,4K sep  3 17:46 favicon.ico*
-r-x---r-x 1 strompf strompf  182 sep  3 17:46 hoekje10.png*
-r-x---r-x 1 strompf strompf   79 sep  3 17:46 hoekje-10x10.gif*
-r-x---r-x 1 strompf strompf  857 sep  3 17:46 hoekje.gif*
-r--r--r-- 1 strompf strompf  18K sep  3 17:46 LICENSE.txt
-r-xr-xr-x 1 strompf strompf  53K sep  3 17:46 logo.png*
-r-xr-xr-x 1 strompf strompf 3,6K sep  3 17:46 README.txt*
-r-xr-xr-x 1 strompf strompf  56K sep  3 17:46 screenshot.png*
dr-xr-xr-x 2 strompf strompf 4,0K jul 11 12:32 scripts/
-r-xr-xr-x 1 strompf strompf  14K sep  3 17:46 template.php*
dr-xr-xr-x 3 strompf strompf 4,0K sep  3 17:46 templates/
-r-xr-xr-x 1 strompf strompf  13K sep  3 17:46 theme-settings.php*

Nu is alles niet-beschrijfbaar, en zou je ook niet kunnen updaten...

drush up
Update information last refreshed: Thu, 11/24/2016 - 15:56
 Name                           Installed Version  Proposed version  Message                   
 Drupal                         7.50               7.52              SECURITY UPDATE available 
 Chaos tools (ctools)           7.x-1.10           7.x-1.12          Update available          
 Entity API (entity)            7.x-1.7            7.x-1.8           Update available          
 Views megarow (views_megarow)  7.x-1.6            7.x-1.7           Update available          
 AT Commerce (at_commerce)      7.x-3.1            7.x-3.2           Update available          


NOTE: A security update for the Drupal core is available.
Drupal core will be updated after all of the non-core projects are updated.

Code updates will be made to the following projects: Chaos tool suite (ctools) [ctools-7.x-1.12], Entity API [entity-7.x-1.8], Views Megarow [views_megarow-7.x-1.7], AT Commerce [at_commerce-7.x-3.2]

Note: A backup of your project will be stored to backups directory if it is not managed by a supported version control system.
Note: If you have made any modifications to any file that belongs to one of these projects, you will have to migrate those modifications after updating.
Do you really want to continue with the update process? (y/n): y
Project ctools was updated successfully. Installed version is now 7.x-1.12.
Backups were saved into the directory /home/strompf/drush-backups/example.com/20161124145615/modules/ctools.                                                                                                             [ok]
Project entity was updated successfully. Installed version is now 7.x-1.8.
Backups were saved into the directory /home/strompf/drush-backups/example.com/20161124145615/modules/entity.                                                                                                             [ok]
Project views_megarow was updated successfully. Installed version is now 7.x-1.7.
Backups were saved into the directory /home/strompf/drush-backups/example.com/20161124145615/modules/views_megarow.                                                                                                      [ok]
Project at_commerce was updated successfully. Installed version is now 7.x-3.2.
Backups were saved into the directory /home/strompf/drush-backups/example.com/20161124145615/themes/at_commerce.                                                                                                         [ok]

Code updates will be made to drupal core.
WARNING:  Updating core will discard any modifications made to Drupal core files, most noteworthy among these are .htaccess and robots.txt.  If you have made any modifications to these files, please back them up before updating so that you can re-create your modifications in the updated version of the file.
Note: Updating core can potentially break your site. It is NOT recommended to update production sites without prior testing.

Do you really want to continue? (y/n): y
Project drupal was updated successfully. Installed version is now 7.52.
Backups were saved into the directory /home/strompf/drush-backups/example.com/20161124145615/drupal.                                                                                                                     [ok]
4 byte UTF-8 for mysql is disabled. See the documentation on adding 4 byte UTF-8 support for more information. (Currently using Database 4 byte UTF-8 support Disabled)                                               [warning]
 System  7081  Remove the Drupal 6 default install profile if it is still in the database.  
 Dblog   7003  Account for possible legacy systems where dblog was not installed.
Do you wish to run all pending updates? (y/n): y
4 byte UTF-8 for mysql is disabled. See the documentation on adding 4 byte UTF-8 support for more information. (Currently using Database 4 byte UTF-8 support Disabled)                                               [warning]
Performed update: 
dblog_update_7003                                                                                                                                                                                   [ok]
Performed update: system_update_7081                                                                                                                                                                                  [ok]
'all' cache was cleared.                                                                                                                                                                                              [success]
Finished performing updates.                           

...Helaas: De theme-bestanden zijn wel degelijk aangepast. Zie de timestamp van dit bestand:

-rw-r--r-- 1 strompf strompf  18K nov 24 16:00 at_commerce.info

Ik pas toch weer de methode toe met de backup in een aparte map, die ik na een update terugschrijf.

Casus aug. 2018 (1)

Themes backuppen:

cd site/all/themes
cp -r adaptivetheme/ adaptivetheme_bk
cp -r at_commerce/ at_commerce_bk

Theme updaten:

drush up -y

...WSOD. Terugzetten van bestanden wil niet lukken ⇒ Backup van de server teruggezet.

Casus aug. 2018 (2) - Gelukt

Aanvullende gegevens

  • Gebruikte theme: AT Commerce. Dit is een subtheme van Adaptivetheme
  • Gebruik footheme child-theme, werkt niet details

Acties

  • Gewoon updaten. Vantevoren maakt-ie automatisch een backup
  • Info-bestand teruggezet middels cp at_commerce.info /var/www/example.com/sites/all/themes/at_commerce/ + refresh ⇒ Geen verschil
  • CSS-bestanden gekopiëerd middels cp -r css/* /var/www/example.com/sites/all/themes/at_commerce/css + refresh ⇒ Vormgeving weer als vanouds! Je hebt trouwens allebei deze acties nodig!
  • Daarna at_commerce.info bijwerken: Onderaan dit bestand staat een versie-nummer. Dat moet je handmatig bijwerken. Anders blijft-updaten en blijft het probleem terugkomen. Hieraan kun je trouwens ook zien, dat het info-bestand wordt overschreven bij updates.

Zie ook

Bronnen