Closed (fixed)
Project:
Bibliography Module
Version:
6.x-1.x-dev
Component:
Miscellaneous
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
19 Feb 2009 at 13:06 UTC
Updated:
16 Apr 2009 at 12:30 UTC
When you edit an entry and change the name of a contributor, the old contributor is not deleted in the biblio_update() hook. Thus, an orphaned contributor (which is probably misspelled) remains in the database.
It would be then desirable to remove orphaned contributors automatically, which can be done adding the query:
db_query('DELETE FROM {biblio_contributor_data} WHERE cid NOT IN (SELECT DISTINCT(cid) FROM {biblio_contributor})');
In the biblio_update() hook, which removes contributors which are not related to a node. The same can be done for removed nodes in the biblio_delete() hook.
Would this have an undesired side effect?
Comments
Comment #1
rjerome commentedThe reason it's not done automatically is that in some cases you may want to prepopulate or retain authors in the database in order to enhance the autocomplete capability. i.e. a university might enter all it's faculty members so that when entering a new paper, auto-complete will produce consistent results.
I could make it an option to automatically delete orphans if so desired.
Ron.
Comment #2
mlncn commented+1 for an option to delete orphaned authors automatically. Where we (some SCF sites) have all our data pulled in from pubmed, this helps us keep the data clean.
benjamin, Agaric Design Collective
Comment #3
rjerome commentedThis is now in the -dev release. Look for an option on the settings page under the "Authors" section. It is turned OFF by default.
Ron.
Comment #4
mlncn commentedFantastic! Tested and approved, heh.