Score:0

Is there a way to downgrade core from 9.3.6 to 9.2.7?

ua flag

After updating the Drupal core version from 9.2.7 to 9.3.6 I got an error.

TypeError: Argument 1 passed to Drupal\Core\File\FileUrlGenerator::generateAbsoluteString() must be of the type string, null given

I tried to apply the patch in TypeError: Argument 1 passed to Drupal\Core\File\FileUrlGenerator::generateString() must be of the type string, null given but it gives an error.

Could not apply patch! Skipping. The error was: Cannot apply patch 3254245-78.patch.

Is it possible to downgrade the core version to get rid of this issue?

berliner avatar
bd flag
Which patch from that issue did you try? The latest ones are against 9.4, so it doesn't surprise that they don't apply. Maybe try https://www.drupal.org/project/drupal/issues/3254245#comment-14339531 before downgrading. And yes, downgrading core is an option, but probably not the best one. Drupal 9.2 is still maintained until June 15, 2022, see https://www.drupal.org/about/core/policies/core-release-cycles/schedule
Sam Bara avatar
ua flag
I tried to apply the patch you mentioned but I am getting the same error
apaderno avatar
us flag
Just wait the patch is committed. Usually, they commit it on Drupal 9.4 and Drupal 9.3. As @berliner said, the latest working patch is for Drupal 9.4; without cherry-picking, it's not possible to use it on Drupal 9.3.
Score:0
cn flag

If you already ran the database updates, no, you cannot downgrade; you need to fix the error.

If you did not run the database updates, you should be able to revert the code (for example, in git if you're using that) without any problem.

The real solution is to always make a database backup (and code backup if you are not using version control) before updating anything.

If you already have a database backup

You can re-install the old version of Drupal (9.2.7) and then restore the database backup and everything should be fine. You can do it locally with whatever environment you are using to develop your site.

Sam Bara avatar
ua flag
I have the database backup, but I am not using any type of version control is it possible to do it in local environment
cn flag
@SamBara Yes, should be no problem. Restore the code; then restore the database.
Sam Bara avatar
ua flag
can I use the same method which is used to upgrade Drupal manually like deleting all the file except the sites, module and profile file and then paste the file from this zip
cn flag
@SamBara Yes, you can. You can install an old version in exactly the same way that you upgrade to a new version. In the future, you can make your life a lot easier if you learn to use git for version control and install Drupal that way; using git, you can undo a bad upgrade with a single command (`git revert`) and a database restore.
Sam Bara avatar
ua flag
Thanks for the help my site is up and running again.
cn flag
@SamBara You're welcome. However, on *Drupal Answers* and other Stack Exchange network sites, you don't need to say thanks; instead, check the checkbox to accept the answer and upvote the question by clicking the up arrow.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.