Closed (fixed)
Project:
Backup and Migrate
Version:
5.1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
8 Mar 2022 at 17:09 UTC
Updated:
26 Sep 2022 at 19:39 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
mok7tar commentedthis patch for backup_migrate": "^5.0" stable version
Comment #3
damienmckennaThank you for the patch.
I suspect there might be a different problem. Why are the files being passed to filectime() and filesize() coming back with NULL values?
Comment #4
damienmckennaComment #5
mok7tar commented@damienMcKenna
on
src/Core/File/ReadableStreamBackupFile.php Line 60
public function realpath() {
if (file_exists($this->path)) {
return $this->path;
}
return NULL;
}
realpath return null if file not exist on input path
Comment #6
mok7tar commentedSo we can replace this patch with centralized solution for rela path method
Comment #7
damienmckennaI think they should throw an exception if the file can't be found instead of just returning some sort of an empty string.
Comment #8
mok7tar commentedyes i think it will be better
Comment #9
donpwinston commentedThese two patches do not fix the problem. The filename should not be empty. I get the following:
I think closing the file and/or the __destruct method is blowing away the path property before loadFileSats() is called. In the close() method maybe parent::close() should be at the end?
Nope. Tried that and it and still got error. I do not know why the $path is null.
Comment #10
Christopher Riley commentedthe latest patch doesn't work via composer patches when the root directory is not web. I pulled the patch and manually ran the patch routine pointing it to the correct directory and seems to have resolved the issue.
Comment #11
robcarrRecent patches wouldn't apply to 5.0.x nor 5.1.x. Have re-rolled the palliative patch that returns an empty (rather than a NULL) value to avoid the deprecation error. Changed to 5.1.x branch
Comment #12
crutch commented#11 applies and removes deprecated function warnings. Not seeing issues as described in #9.
Comment #13
damienmckennaThis is showing up when tests are ran on D10, so it has bumped in importance a little.
Comment #14
damienmckennaThis affects both the 5.0.x and 5.1.x branches.
Comment #15
ericdsd commentedPatch #11 applied on 5.0.2, works like a charm.
@donpwinston I didn't get how to reproduce issue mentioned in #10,could you explain the steps to reproduce ?
Comment #16
damienmckennaAfter some looking I found that the problem was simpler than this - in ReadableStreamBackupFile::loadFileStats() it shouldn't be trying to get meta data if the file doesn't exist.
Comment #17
solideogloria commentedIn
ReadableStreamBackupFile.php, it still should probably have return type ofstring|nullif it's going to return NULL sometimes.Comment #18
damienmckennaGood point!
Comment #19
solideogloria commentedSorry, one more nitpick I noticed.
BackupFileWritableInterfaceextendsBackupFileReadableInterface, so it doesn't need to have its ownpublic function realpath();, unless I'm mistaken.Comment #21
damienmckennaYes, you are correct.
Committed, minus the duplicated code in BackupFileWritableInterface.
Thanks everyone!
Comment #22
solideogloria commentedThank you!