- Issue created by @mrshowerman
- Merge request !52Issue #3467450: Failsafe conversion of block_classes_stored β (Open) created by mrshowerman
- π§π·Brazil renatog Campinas
Nice catch. Thanks for the MR
Added thread above there
- Issue was unassigned.
- Status changed to Needs review
3 months ago 7:18pm 12 August 2024 - π©πͺGermany szeidler Berlin
Just a note to the initial issue description: it is quite risky to run drush config:import before drush up.
If you deploy changes the best practice order is https://www.drush.org/12.x/deploycommand/ or the corresponding documented individual commands.
- π«π·France dydave
Thanks a lot Stephan (@szeidler) for the very helpful feedback!
Unrelated with this ticket, but just by curiosity:
To deploy/build a project, do you usually like using thedrush deploy
command or rather each one of the commands separately?drush updb drush cr drush cim drush cr
along with
hook_install
I've seen projects use a lot
hook_deploy
, along withdrush deploy
, but personally, I'm not a big fan...Would be glad to hear if you have any thoughts on that.
Thanks in advance! - π©πͺGermany mrshowerman Munich
Thanks @szeidler for making this clear.
We have a typical scenario where we need to migrate fields from one type to another (e.g. plaintext to formatted text), so we first import configuration to add the new field, then run updates to copy the field values over throughHOOK_update_N()
. Doing it the other way around would not work, since the new field does not exist when the hook is run.
Wasn't aware ofHOOK_deploy_NAME()
, which seems to improve things a lot. Will look deeper into it.Nevertheless, I still think that update script should not fail if for whatever reason the setting has already been updated.
- Status changed to RTBC
3 months ago 1:54am 20 August 2024 - π³πΏNew Zealand stewest Wellington
This patch works to now now allow database updates to run
block_class 20017 hook_update_n 20017 - Convert block_classes_stored from JSON to a sequence.
https://git.drupalcode.org/project/block_class/-/merge_requests/52.diff
- πΊπΈUnited States rkelbel48
I can also confirm the patch works as needed, database updates run just fine now.
- π΅πPhilippines mjgruta
+1 RTBC
If you already run database update. You can run below command to re-execute the database update.
Make sure you already applied the patch.drush ev "\Drupal::service('update.update_hook_registry')->setInstalledVersion('block_class', 20016);";
drush updb; - πΊπΈUnited States thejimbirch Cape Cod, Massachusetts
Thanks for this. The patch works. Updating to the 4.x branch as the 2.x is now deprecated. +1 for RTBC