There are a few potential improvements for the file_entity_file_insert and file_entity_file_update functions.
1. The db_merge function is used to insert data into the file_metadata table, when a simple db_insert is sufficient.
2. There is duplicate code in the file_entity_file_update function.
3. The db_delete function in file_entity_file_update function doesn't get executed (which might be the reason for the db_merge).
Patch to come.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | file_entity-file-insert-update-improvements-2130921-1.patch | 1.96 KB | Schoonzie |
Comments
Comment #1
Schoonzie commentedComment #2
hefox commentedWorking and seems good
Comment #3
sheldonkreger commented1: file_entity-file-insert-update-improvements-2130921-1.patch queued for re-testing.
Comment #4
dave reidI converted the db_insert() calls to a just one query with multiple inserts, and committed to 7.x-2.x.