Replacing file does not update title on older records

30 views
Skip to first unread message

Stephen S

unread,
Aug 18, 2015, 7:20:07 AM8/18/15
to ResourceSpace
Hi I have a strange problem:

We recently updated from an old version of RS to 7.1. Now when we replace an image (containing meta data) in a pre-update record with a new one, all the meta data fields are being updated in the RS db EXCEPT for title. 

If we upload a brand new image and save a new record, then replace an image in the new record, all fields including title ARE updated. So it is only the old records which refuse to replace title with the metadata contained in the file. 

Has anyone seen this before? Does anyone have any pointers as to why this may be happening?

Stephen S

unread,
Aug 19, 2015, 12:50:07 PM8/19/15
to ResourceSpace
I finally figured this out myself, I hope that this will help someone else who was experiencing this problem.

The difference after the upgrade is that the 'file_path' field in the resource table was set in all the old records, but not in the new. When I took a look at image_processing.php (in the include folder), I could see that on line 361 code was looking to see if there was a value in that field (indicating that we were using staticsync, which we never were), and preventing the title field (8) from updating.

So (since we are NOT using staticsync), a simple query to set all those values to null solved our problem:

UPDATE `resource` SET `file_path`=NULL WHERE `ref`>'100'; 

(our ref numbering begins above 100, hence that value and I didn't want to mess with the single digit and negative refs since they are special)

Hope this info helps someone else out there.
Reply all
Reply to author
Forward
0 new messages