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.
There is a fatal error when attempting to restore "Entire Site (code, files & DB)."
Fatal error: Call to undefined function file_directory_path() in sources.archivesource.inc on line 211
Steps to reproduce:
- Install clean Drupal 7.41
- Configure private files system in
/admin/config/media/file-system
- Install backup_migrate 7.x-3.x-dev
- Do a quick backup of "Entire Site (code, files & DB)" to "Manual Backups Directory" using "Default Settings"
- Attempt to "Restore from a saved backup" to "Entire Site (code, files & DB)" and receive fatal error
The function file_directory_path()
was removed in D7. This was mentioned kinda in #2269541: Failed to restore "Entire site (code, files & DB)", but the issue seems to have become a catch all for any issue related to restoring.
Comment | File | Size | Author |
---|---|---|---|
#2 | backup_migrate-restore_entire_site_fatal_error-2618516-2.patch | 802 bytes | rocketeerbkw |
Comments
Comment #2
rocketeerbkw CreditAttribution: rocketeerbkw commentedAccording to https://www.drupal.org/update/modules/6/7#file_directory_path this is the correct fix.
Comment #3
kenorb CreditAttribution: kenorb commentedThis function doesn't exist anymore in Drupal 7, therefore it should be replaced so the patch is valid.
See: https://api.drupal.org/api/drupal/includes%21file.inc/function/file_dire...
Related: Why does nothing change when I attempt to restore a backup?
Comment #4
kenorb CreditAttribution: kenorb commentedComment #5
mastoll CreditAttribution: mastoll commentedI don't think this issue has been resolved and is very difficult to follow with references to other issues. Can anyone please post a valid patch here?
Comment #6
rocketeerbkw CreditAttribution: rocketeerbkw commentedThe patch in #2 is valid and still applies cleanly to the latest backup_migrate.
Comment #7
hgoto CreditAttribution: hgoto as a volunteer commentedI tested the patch #2. After applying the patch, the error doesn't occur and the restoration process works well.
And I think the change in the patch is quite logical on the point rocketeerbkw stated.
I'd like to move this to RTBC. Thank you for the patch.
Comment #10
Alex Andrascu CreditAttribution: Alex Andrascu at Intellix commentedPushed to 7.x-3.x-dev. New release to follow soon.
Comment #11
DamienMcKennaComment #12
Anonymous (not verified) CreditAttribution: Anonymous as a volunteer and commentedHello,
There seems to be confusion between several problems here. I have spent a long time struggling with this.
#6 of Issue https://www.drupal.org/node/2466235 says effectively that the inability to restore modules or themes from an Entire Site backup is by design. However, I can see nothing in any documentation that makes this clear. In addition one seems to get a general failure error message, or a blank white screen if you try to do so.
The User interface should only allow one to restore to the database or files, and not attempt to restore to the Entire Site.
Tony
Comment #13
rocketeerbkw CreditAttribution: rocketeerbkw commentedIt's unfortunate this has caused so much confusion for many people, let me try to explain more clearly.
This issue exists only only to fix one very specific fatal error. If you see
when trying to restore a full site backup, you're in the right place. Even better, you can upgrade to 7.x-3.2 as this has been fixed in this issue and is included in the latest release.
If you don't get that fatal error when attempting to restore "Entire Site (code, files & DB)" then you have another problem and should open, or find, another issue.
If you see a blank white screen, first follow the advice on dealing with White Screens of Death (WSoD) so that you can find out what the real error is. That will help you find an issue if it exists, or create a new issue with useful information.
Comment #14
Anonymous (not verified) CreditAttribution: Anonymous as a volunteer and commentedThank you. My WSoD problem seems not to be reproducible, so I agree this issue is fixed when I tried in 7.x-3.2.
Tony