Closed (won't fix)
Project:
Upload File Replace (for filefield CCK)
Version:
6.x-1.2
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
10 Sep 2012 at 15:03 UTC
Updated:
3 Dec 2020 at 01:23 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
dpearcefl commentedFound another error that needs to be fixed. Here is the fixed function declaration.
The function parameter should not be a reference.
Patch for both issues is attached.
Comment #2
cybermache commentedSo far your changes seem to be working for me.
Thanks
Comment #3
anybodyWe've got the same error. Is there an active maintainer who can create a new release, if we fix this?
Comment #4
Anonymous (not verified) commentedIs there any progress?
Comment #5
developerchris commentedThis is still an issue as of the date of this post.
The problem is the module incorrectly uses the hook_file_update() hook and assumes quite incorrectly that the parameter is a reference
The reason it uses a reference is because it alters the $file object.
I assume this is so future function calls have the correct filename. Unfortunately that does not work and therefore can adversely effect other modules.This means that there may be unintended consequences of using this module.
I cannot see in drupals hooks how you can alter the destination filename during the save process.
This line in upload_replace.module
is equivalent to
so is entirely redundant and does not work as the author intended
For the reasons above I strongly suggest not using this module
Comment #6
Dru18 commentedIt seems the issue has been resolved with 7.x-1.0-beta1+2-dev.
Regarding the above commenter's advice not to use the module because of "unintended consequences." I wonder if there is a clear evidence of it.
When file updating, file_save() function invokes these hooks.
entity_update simply updates (updated) date. I don't see anything that may create consequences. Am I missing something here?
Comment #7
developerchris commentedThe unintended consequences is that other modules hooks do not get the new filename instead they get the unchanged filename this may result in other hooks operating on the wrong file.
Comment #8
phjouDrupal 6 has reached end of support. Close this issue.