When we want to rename a file in the root IMCE folder it seems to work fine, however when I want to rename a file in a subfolder I get the following error:
An AJAX HTTP error occurred.
HTTP Result Code: 500
Debugging information follows.
Path: /imce?jsop=rename&dir=lessons
StatusText: Service unavailable (with message)
ResponseText: Recoverable fatal error: Argument 1 passed to file_move() must be an instance of stdClass, boolean given, called in mysite.com/web/sites/all/modules/imce_rename/imce_rename.module on line 101 and defined in file_move() (line 999 of mysite.com/web/includes/file.inc).
Comment | File | Size | Author |
---|---|---|---|
#9 | imce_rename-file_move-1376260-9.patch | 1.06 KB | Maedi |
#8 | imce_rename-file_move-1376260-8.patch | 994 bytes | jmuzz |
#5 | 1376260_imce_rename_file_move-5.patch | 993 bytes | hefox |
#3 | 1376260_imce_rename_file_move-1.patch | 1.05 KB | hefox |
#1 | imce_rename.patch | 1.16 KB | Anthony Gaudino |
Comments
Comment #1
Anthony Gaudino CreditAttribution: Anthony Gaudino commentedI think I solved this issue. See the attached patch for the 7.x-1.x-dev version.
This problem was caused by not having a file entry in the file_managed table.
Every time you try to rename/move a file the module get a file object from this table, since theres no entry to the table, there will not have any data in the generated $file object.
I didn't notice this problem with folders, because they don't have a entry and the rename/move operation is different.
Comment #2
Jochen Wendebaum CreditAttribution: Jochen Wendebaum commentedThe patch works fine, I would recommend to add it to the release! :-)
The only minor thing is that it jumps you back to the root folder. But this is not really a problem.
Comment #3
hefox CreditAttribution: hefox commentedPatch has some malformed characters at bottom
Comment #4
hefox CreditAttribution: hefox commentedComment #5
hefox CreditAttribution: hefox commentedfixing file name so applies with -p1
Comment #6
jmuzz CreditAttribution: jmuzz commentedI got this error even for files in root of public:// .
#5 worked for me.
Comment #7
hefox CreditAttribution: hefox commentedif( needs a space
Comment #8
jmuzz CreditAttribution: jmuzz commentedYes.
Comment #9
Maedi CreditAttribution: Maedi at Morpht commentedI've updated the patch to properly create the file object before assigning property values to it. Which fixes this warning:
Warning: Creating default object from empty value in imce_rename_file() (line 116
The module hasn't been updated in 5 years and this patch is 3 years old. Please someone apply this! The module doesn't work without it.
Comment #10
XorunaI applied the patch in #9 but it failed at line 36. Then I tried the patch in #8, it works nice. Thanks.