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:

  1. Install clean Drupal 7.41
  2. Configure private files system in /admin/config/media/file-system
  3. Install backup_migrate 7.x-3.x-dev
  4. Do a quick backup of "Entire Site (code, files & DB)" to "Manual Backups Directory" using "Default Settings"
  5. 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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

rocketeerbkw created an issue. See original summary.

rocketeerbkw’s picture

Status: Active » Needs review
FileSize
802 bytes
kenorb’s picture

This function doesn't exist anymore in Drupal 7, therefore it should be replaced so the patch is valid.

$ drush -y dl backup_migrate-7 --dev
Project backup_migrate (7.x-3.x-dev) downloaded to /Users/kenorb/temp/drupal/contrib/backup_migrate.
$ grep -R file_directory_path .
./backup_migrate/includes/sources.archivesource.inc:        _backup_migrate_move_files($filepath, file_directory_path());

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?

kenorb’s picture

Priority: Normal » Major
mastoll’s picture

I 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?

rocketeerbkw’s picture

The patch in #2 is valid and still applies cleanly to the latest backup_migrate.

hgoto’s picture

Status: Needs review » Reviewed & tested by the community

I 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.

According to https://www.drupal.org/update/modules/6/7#file_directory_path this is the correct fix.

I'd like to move this to RTBC. Thank you for the patch.

Alex Andrascu’s picture

Pushed to 7.x-3.x-dev. New release to follow soon.

DamienMcKenna’s picture

Status: Reviewed & tested by the community » Fixed
Anonymous’s picture

Hello,

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

rocketeerbkw’s picture

It'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

Fatal error: Call to undefined function file_directory_path() in sources.archivesource.inc on line 211

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.

Anonymous’s picture

Thank 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

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.