Islandora-Devops / isle-dc

ISLE 8 - Dockerized Islandora 8 Deployment orchestrated with docker-compose
MIT License
23 stars 60 forks source link

Update patch_views.sh #408

Open DonRichards opened 1 month ago

DonRichards commented 1 month ago

Drupal console is no longer being maintained and the latest version of isle-dc doesn't include it. It turns out it's pretty difficult to even install it at this point.

This PR is to:

  1. update this script to use drush
  2. Add some debug visibility incase something goes wrong by outputting the enabled views list to a text file.
  3. Works on 1 view at a time (instead of disabling everything and then re-enabling the ones from the list)

To test:

Run the make command.

make fix_views

Output:

Successfully copied 4.1kB to isle-dc-drupal-1:/var/www/drupal/patch_views.sh
Reloading view: advanced_search
 [success] advanced_search disabled.
 [success] advanced_search enabled.
Reloading view: all_taxonomy_terms
 [success] all_taxonomy_terms disabled.
 [success] all_taxonomy_terms enabled.
...

This should only select the enabled views, output the list to a file (/var/www/enabled_views.txt), and for each enabled view disable, then enable the view. Hopefully correcting any broken references within the view. Then it should run a few drush commands to clean up and rebuild cache/menus. This part was already part of the script.

This script could use some improvements but to keep the scope of this PR focussed it's mainly to replace drupal console with drush.

alxp commented 1 month ago

Getting an error message when I run the script:


iMac:isle-dc aoneill$ make fix_views
Successfully copied 4.1kB to isle-dc-drupal-1:/var/www/drupal/patch_views.sh
/var/www/drupal/patch_views.sh: line 10: syntax error near unexpected token `('
 [success] Cache rebuild complete.
iMac:isle-dc aoneill$ 
aOelschlager commented 4 weeks ago

I just looked at the patch_views script and I think that error is happening because this line is meant to be a comment but is missing the "#" https://github.com/Islandora-Devops/isle-dc/blob/replace_console_with_drush/scripts/patch_views.sh#L10

DonRichards commented 3 weeks ago

Thanks Annie. I think you're right.

alxp commented 1 week ago

I still seem to be getting a syntax error when running the make command:


Alexanders-MacBook-Pro:isle-dc alexanderoneill$ make fix_views 
                                             Successfully copied 4.1kB to isle-dc-drupal-1:/var/www/drupal/patch_views.sh
/var/www/drupal/patch_views.sh: line 64: syntax error: unexpected end of file
 [success] Cache rebuild complete.
Alexanders-MacBook-Pro:isle-dc alexanderoneill$ git pull origin `gcb`
From github.com:Islandora-Devops/isle-dc
 * branch            replace_console_with_drush -> FETCH_HEAD
Already up to date.
Alexanders-MacBook-Pro:isle-dc alexanderoneill$ 

@DonRichards Any ideas?

DonRichards commented 1 week ago

@alxp OK, I rewrote a lot of it to provide more clarity and to fix the error.