Closed (fixed)
Project:
Resource Description Framework (RDF)
Version:
6.x-1.0-alpha6
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Issue tags:
Reporter:
Created:
12 Mar 2009 at 19:58 UTC
Updated:
18 Mar 2009 at 19:13 UTC
file_data_save saves duplicate data to the rdf_data_file table for files that have already been uploaded and attached to a particular node, but are being uploaded and attached again.
Seems this should be checked against before calling file_data_save?
Comments
Comment #1
miglius commentedArto, I think this falls in the RDF domain. When the same file is uploaded again, I delete the file's metadata from the RDF and shortly insert into the RDF a newly extracted metadata. It seems that the RDF data is not deleted from the RDF.
I use
which by the rdf_db_rdf_delete() is turned in to
The problem is the 'created' field. When it is not specified in the $options array, _rdf_db_make_record() uses a time() function to fill it, which is of course different from the 'created' field stored in the database.
I see the potential problem with a 'uid' field as well. If the same file is uploaded by different users I don't want it's metadata be saved twice in the RDF (with separate uid field). When a new file is uploaded, the File Framework deletes it's metadata (if exists) from the RDF and then reinserts extracted metadata shortly. This way metadata is tagged with the last user's, which uploaded the file, uid. The metadata from the RDF is removed only when the last file reference to the blob is removed. It might happen that uid of the user removing the metadata from the RDF will not match the uid field that of the saved RDF data.
Any thought how this could be solved?
Comment #2
Arto commentedUnfortunately this was a bug that slipped through to the previous RDF release. It has since been fixed in CVS changeset [178320] so using the latest RDF 6.x-1.x-dev snapshot should solve the problem (please report back if it doesn't).
I'll try and get a new RDF release out the door as soon as possible. It might be today or tomorrow if I can complete remaining task list in time.
Comment #3
dsw9742 commenteddon't think it quite works yet, i *think* fileframework is looking for a repository called "file", but RDF is only returning "system" and "local."
I disabled fileframework modules, then I disabled and uninstalled RDF, downloaded HEAD, installed and enabled RDF. Ran the update script just in case. Reenabled fileframework modules.
Returned to my existing Image node, re-uploaded the same image, and got the following error: Error saving file [picture name]. Please, contact site administrator.
Went to watchdog and found "RDF data was not deleted" errors that I traced back to fileframework's file.inc line 152. I've tracked it all the way back to the rdf_get_repositories() call. Not sure if there's a hook_install() error somewhere that should create a repository called "file." It might be that I did not fully uninstall the fileframework. It also might be that I'm confusing bitcache and RDF repositories and that I have not yet fully grasped the relationship between all three of these modules.
Hopefully this helps, I'll continue to look into this as I get some time.
Comment #4
dsw9742 commentedReopening as its still not working for me. Does this work for others now?
Comment #5
febbraro commentedI just noticed I am having the duplicate data problem too. Will test this fix today and report back.
Comment #6
febbraro commented@dsw9742 After updating the the newest dev version of this RDF module, did you run update.php? You need to do that b/c it changes how repositories are loaded/identified. Make sure that was done.
I have tested this and it fixes the duplicate data problem.
Comment #7
dsw9742 commentedPretty sure I ran update.php on upgrade, but this time I re-ran it, and selected version 6003 specifically. Happy to confirm this is the fix on my end as well. Thanks all.