- Issue created by @dcdev11
- 🇳🇱Netherlands megachriz
I'm trying to figure out from your bug report what you are trying to do and what problem you actually face. It seems related to importing data into a file field on a node.
Can you explain further with CSV examples what you are importing and at which moment something goes wrong and what goes wrong exactly?
For example:
- Create a feed type using the CSV parser with mapping to Feeds Item Guid, title and a file field. Set Feeds Item guid as unique.
- Import the following CSV file:
id,title,file 1,Foo,http://www.example.com/file1.txt 2,Bar,
If I read correctly, this import goes fine. New records with a text file reference and new records without text a file reference are getting imported.
- Change the CSV file and import again.
id,title,file 1,Foo Updated,http://www.example.com/file1.txt 2,Bar Updated,
Record 2 updates fine, but for record 1 you get an error? Or do you get an error when on an update you reference a different text file? Or do you get an error if on an update the text file doesn't exist on the source?
The following are actually csv entries with dummy data that create a node type. The strings are all plain text, mostly names and other short values. Some numbers are internal, some are public facing and with associated template labels provide location information users can use and sometimes will report if they are inaccurate. The .txt file defines content for. a long description field.
Every week a csv import file is submitted and a feeds import is run. In the most recent case it had over a record hundred changes, but it can be more or less. During the import records with a .txt file that have not been updated (but other fields have been updated) will fail to update, while other records will update as expected. The feeds log will confirm the record(s) that hit the temp files error and the total number of updated/created records will be lower by the number times the error happened.
Working record update
The .txt file and nothing else had been updated and the error didn't occur. This was an updated record, but if this had created a new record for the first time it appears to work as well from my testing on the dev site. It also would work if the other data had been updated along with the .txt file.“123”,”string”,”123,”string”,”string”,”123”,”123",”date”,”123”,”123”,”123”,”123”,"123,” ","string","string","string","string"," ","updated.txt","","string","123"
Several other times, the records looked this. The "345" represent updated numeric data in the record field values. "same.txt" indicating no changes to the file contents (in either case the name of the file doesn't usually change). In this instance an error happens following this pattern "File 'temporary://filegqK5QQ' could not be copied because a file by that name already exists in the destination directory ('') and the record can't be updated with feeds.
Failing record update
“123”,”string”,”123,”string”,”string”,”123”,”123",”date”,”345”,”345”,”345”,”345”,"123,” ","string","string","string","string"," ","same.txt","","string","123"Most records don't have .txt files and update without issue
Less advanced working record update
“123”,”string”,”123,”string”,”string”,”123”,”123",”date”,”345”,”345”,”345”,”345”,"123,” ","string","string","string","string"," ","","","string","123"A typical node will look like this, but the fields are optional so some records have a lot more then others.
"John/Jane Doe" //title
"John/Jane Doe associates/associations"
"More John/Jane Doe associates/associations"
"a long description field" (from the .txt file)
"an image of John/Jane Doe"
"location data" ( a typical pattern this is tba and left blank, then added a month or so later)
"date created"
A couple of internal id fields that aren't displayed.Looking at this I think I see an issue I didn't explain. The .txt files is extracted and become the description field value so it's not url link value or a file download location anything. A typical .txt is like bio, so it's content says "John Doe worked at the company 40 years and did all this stuff..." and that become the description field.
id,title,file
1,Foo,http://www.example.com/file1.txt
2,Bar,id,title,file
1,Foo Updated,http://www.example.com/file1.txt
2,Bar Updated,Both of these would be expected to work if the file1's contents was updated. If we changed 40 to 50 in the years "John Doe worked at the company 50 years and did all this stuff..." then I'd expected to see any updates added to the record.
If bar is updated, but file1 is the same content it generates a temp file, gets stuck, throws an error and bar is not updated in the record.