Hi Ron,

with the 6.x version of the module you introduced the contributor tables, which solves the author association problem effectively.
But I don't understand why you present all different contributor types in a single fieldset within the input form. This way you can't control for these types separately whether they are required, visible, etc. within specific publication types. For example, some publication types need an editor and some not.

In the table biblio_contributor_type you have the auth_category field. I'm not sure what it is used for currently. But I propose the following:
Use this category (which resembles biblio_authors, secondary_authors, etc. from 5.x version?) to (re)introduce appropriate contributor fields in biblio_fields, each having the type contrib_widget. In admin/settings/biblio/defaults you can define their default properties and override them in admin/settings/biblio/types/edit/%tid.
Each of those auth_categories would generate its own input fieldset allowing several authors to be entered. If you allow to assign several auth_types to a single auth_category (using a multiple choice selection) it is even possible to assign different author roles (e.g. main author, secondary author, supervisor) to the authors of a paper for example. Later this could be used to theme those author types differently.

Comments

rjerome’s picture

I see where you are coming from, although I'm not sure separating them by "type" is such a good idea since just recently someone told me that the mix types within the same author string. I think all that's really required is the ability to make individual author types "required" or not. Now the question is how to best accomplish this.... Have to think on it a bit.

Ron.

rhaschke’s picture

Mixing types within the same category would be possible if several author types are allowed per category as I pointed out. I've read your discussion with Frank Steiner and I definitely support this feature.
This feature request is not only about making individual author types required or not. I propose to have different fieldsets in the input form, which can be weighted differently and which define a superordinate label for the associated contributors, e.g. "Authors" for primary and secondary authors. This label could be used for export as well (at least bibtex, I don't know the other formats).
There is another major problem with the current design: If you change the auth_type of a contributor field (in admin/settings/biblio/types/edit/%tid) having authors defined with the previous auth_type, these authors will not be displayed anymore, neither in the input form nor in the view.

Cheers, Robert

rjerome’s picture

So if I understand correctly, your proposal would do away with the author "Type" select box and use the fieldset to indicate the author type?

There is another major problem with the current design: If you change the auth_type of a contributor field (in admin/settings/biblio/types/edit/%tid) having authors defined with the previous auth_type, these authors will not be displayed anymore, neither in the input form nor in the view

I just tested this and the existing authors did not disappear, and in the edit form, they still had the same (old) designation. Could you give me the steps you used to produce this problem as it is indeed quite serious if it is reproducible.

Ron.

rhaschke’s picture

I would skip the author type select box only if a single auth_type is associated to the current (tid,auth_category). If there are several choices, I would display them - but only them.

Regarding the vanishing authors:
- I started from a scratch D6 installation, biblio 6.x CVS head
- create new biblio: book, one "author", one "tertiary author"
- in admin/settings/biblio/types/edit/100 change the "Tertiary author" type to "Editor"
- reload the created biblio node: the entered tertiary author is vanished completely, neither displayed as "tertiary author" nor as "editor"

Robert

rjerome’s picture

Ok, I see that behavior now. Strangely, it doesn't happen on node that I imported from a file, only ones created from the form. I'll have to dig a bit deeper...

rjerome’s picture

I found the problem, but I don't have a solution yet... Changing the auth_type on admin/settings/biblio/types/edit/%tid updates auth_type in biblio_contributor_type but auth_type in biblio_contributor remains unchanged. This would require going through the biblio_contributor table and finding the entries with biblio_type=tid and auth_type = old_auth_type updating the auth_type to the new value.

I'm seriously questioning the wisdom of relating author types with publication types, as this is the root of the problem.

rhaschke’s picture

Having author types related to publication types is a nice thing. You don't want to see all author types in all publication types.
I see two possible solutions:

  1. The first you already mentioned: One could also update the appropriate entries in biblio_contributor using an appropriate SQL UPDATE statement. Having all these entries updated automatically may not the intention of the user. Eventually he only wants to switch auth_types associated to auth_catagories.
  2. In the edit form you could simply show auth_types associated to auth_catagories as well as auth_types assigned already to any contributors of the current biblio node. In this case its up to the user to change their auth_type.
rjerome’s picture

Your right updating all the auth_type entries in biblio_contributor is probably not the intent, another perhaps simpler approach might be to just add the auth_catagory column to biblio_contributor then each publication could retain it's original author information regardless of what the default is set to. It would also simplify the author lookups since you wouldn't need any joins on the biblio_contributor_type table and you wouldn't need to know the publication type.

rhaschke’s picture

I added a patch, which displays all contributors assigned to a node. The auth_catagory is NULL for contributors having a "wrong" auth_type. For the sake of correctness I add the missing auth_type to the selection box - but only for the respective author. Is it possible to change the format of this obsolete entry?

rjerome’s picture

I'm not sure what you mean by "Is it possible to change the format of this obsolete entry?", could you elaborate?

rjerome’s picture

I just tried this version and my authors still disappear (from the citation display) when the type is changed. Although they are still visible in the edit form. This is because I am using the auth_category in "style" file _format_authors() function.

I'm still thinking that adding auth_category column to the biblio_contributor table might be the solution, because then all the needed to classify the author is attached to each author entry. Right now only half the information is attached to the entry and I'm getting the other half from the publication type, but as we have seen that can change after a publication has been entered.

Also looking at this a bit more, the semantics may be a bit misleading, so just for clarification... "auth_type" is really just the category label. There are 5 categories of authors and and depending on the publication type, the category can assume a different name or label. i.e. a secondary author of a book could be called something different from a secondary author of a journal.

And lastly... I just noticed that I spelled category wrong in the db column name! DOH!

rjerome’s picture

I tried adding duplicating the auth_catagory column in the biblio_contributor table and this does eliminate the problem completely.

I just created a new column called auth_catagory (sic) and used this SQL to copy the data...

UPDATE   biblio b
inner join biblio_contributor bc on b.vid = bc.vid
left join biblio_contributor_type bct on b.biblio_type = bct.biblio_type and bct.auth_type = bc.auth_type
set bc.auth_category=bct.auth_catagory

Then changed bct.auth_catagory to bc.auth_catagory in

>
function biblio_load_contributors($vid, $biblio_type) {
  $contributors = array();
  $query = "SELECT bcd.*, bc.auth_catagory,  bc.auth_type, bc.rank 
...
<
rhaschke’s picture

I see now the semantics of auth_catagory and auth_type. Actually in the current usage, you don't need the auth_type column in biblio_contributors because there is a 1:1 correspondence of catagory (field) and type (label) linked through biblio_type. Your proposed code effectively prevents the author from vanishing. However, it displays the auth_type obtained through linking to auth_catagory, not the auth_type explicitly stated in biblio_contributors.

The idea underlying this issue, was to have author categories as groups / field sets of contributors to be entered. Each entered contributor additionally can get an author type. However, within a single author category several author types should be allowed to have e.g. primary and secondary authors of a publication (which both show up in the "authors" group). Note the difference between primary and secondary authors as author types here w.rt. to the author categories. Actually the author categories could be enumerated 1..5 and don't need to have a name at all.

rjerome’s picture

Your right, there is a 1:1 correspondence of catagory (field) and type (label) linked through biblio_type, however removing auth_type from biblio_contributors we will still have the problem of existing author types being changed when the global default is changed. In a nut shell, the biblio_contributor_type table is used to select which author types show up in the select box on the input form (the UI) and the biblio_contributor table links biblio entries with contributors (the actual data). The problem (disappearing authors) arose from mixing these differently purposed tables.

I hadn't fully modified all the code yet, but the intent was to use both auth_catagory and auth_type from biblio_contributors, not through linking with other tables thus once these values are set for a given author on a particular publication, they would not change. I'm going to make these changes in HEAD so you can see what I mean.

Ok, so assuming we have 5 different "groups" (fieldsets) of authors, what would these groups be called and how would these different groupings be utilized? I think these fieldsets would have to have some kind of name in order for the user to understand what they are for.

rhaschke’s picture

I hadn't fully modified all the code yet, but the intent was to use both auth_catagory and auth_type from biblio_contributors, not through linking with other tables thus once these values are set for a given author on a particular publication, they would not change. I'm going to make these changes in HEAD so you can see what I mean.

If the auth_type should be kept after they are set for a particular publication, you also need to display this (additional) auth_type in the selection box of the particular author. Otherwise this information is lost on next save. That's why I added an appropriate option to the select widget, if the auth_type is not yet in the list. To visualize, that this particular auth_type is not in-line with the auth_category anymore, it would be nice to gray out this option. That's what I meant with changing the format...

Ok, so assuming we have 5 different "groups" (fieldsets) of authors, what would these groups be called and how would these different groupings be utilized? I think these fieldsets would have to have some kind of name in order for the user to understand what they are for.

The field names in biblio_fields for these groups/fieldsets/categories are arbitrary, e.g. biblio_contributors1..5. Or you could use your previous names biblio_authors, biblio_secondary_authors, etc. Their type is always contrib_widget.

The labels for these groups should be defined in biblio_field_type_data and linked to publication types in biblio_field_type as usual.
Ideally, you can choose several author types per category (stored in biblio_contributor_type). The per-publication fields edit form needs to be extended by an appropriate select widget for each category.

rjerome’s picture

I "fixed" the issue of carrying the auth_category with the auth_type, by concatenating them, so the select box in the contrib widget has a string value rather than a single integer (auth_type). For example the select used to return a value of 1 is Author was selected, now it will return a value of 1:1 meaning auth_type=1 and auth_category=1, this way the values can be carried throughout the process.

The other option which you mention and I was also thinking of is to add a second select box for auth_category which might help to disambiguate this for the user. Alternatively, the category (role) (Primary, Secondary, etc.) could be added to the title in the existing select box to give a better indication of what these "titles" represent. i.e. "Author (Primary) " "Series Editor (Secondary)"

I would really like to put this one to rest, so I'll craft the "multi-fieldset" option and see what that looks like

Ron.

rhaschke’s picture

Your fix works nice: The author doesn't vanishes anymore and its auth_type is correctly displayed in the edit form. I added some minor improvements to the code.

Regarding the category, I agree that you shouldn't spent time to display it to the user in the current state. Rather, try to work out the "multi-fieldset" option, where the category is automatically visible to the user through the placement of the author within the corresponding fieldset.

rjerome’s picture

Thanks for that cleanup, especially that update in the install file (I must have been half asleep when I did that). I've done some experiments and I don't think the multi-fieldset option is going to be a big deal mostly just some updates to the database since once those new "fields" (contrib_widgets) are defined in the db, they just magically appear on the form ;-)

Of course there will be a few little tweaks in the form processing code, but it shouldn't be too bad (famous last words).

Ron.

rjerome’s picture

OK, so I updated the biblio.field.link.data.csv file and the biblio.update files, now if you go to "admin/settings/biblio/types" and click the "Reset all types to defaults" button it will update the database with the new contrib_widget definitions. This is destructive (drops 'biblio_field_type_data', 'biblio_field_type' 'biblio_fields', 'biblio_contributor_type'& 'biblio_contributor_type_data' tables) so don't do it if you have any data you don't want to lose. Once this is done, the new widgets will show up on the input form.

I haven't done any of the form processing work yet, but it gives you and idea of what it will look like. I'm quitting for the night.

Cheers,

Ron.

rhaschke’s picture

That already looks promising. Of course I would suggest to rename biblio_contributors to biblio_contributors1 ;-)
I'm not quite sure where to place the author type selection for each category. I suggest placing it right besides the field_name, breaking this column up into two and spanning all other field over both columns.

I added a simple version of the "author merging" GUI, which is directly embedded on the author edit form. Only similar authors are displayed.
If you already have a large database containing hundreds of authors, this GUI is not yet satisfactory. For this I thought about an overview page listing all authors grouped by similar author names with check boxes for merging:

Robert Haschke
O R. Haschke
O R. J. Haschke

Ron Jerome
O R. Jerome

But realizing this is out of my current scope...

rjerome’s picture

I tried the "author merge", that does the trick, however in terms of usability it may leave a little to be desired... For instance I had one author who had 5 different entries, now before merging, I wanted to look at each to decide which had the most complete data and then merge the others with it. In order to do that I had to keep going back to the author page and selecting the other similar author. What I was thinking was that if these were check boxes rather than a select list, you could make the name a hyperlink to the author-edit form so you could just click on one of the names in the merge list and you would be transported to the edit form for that version of the author, that way you could hop between similar authors without going back to the author page.

rjerome’s picture

I took the liberty of changing the "author merge" select list to check boxes with links. Try it out with an author who has more than a few variations and I think you will find this format easier to use.

Ron.

rhaschke’s picture

Your improvement is great. Didn't know that it is so easy to use checkboxes for a selection. I just fixed the biblio base path you used to link to the authors.
To fix a lot of authors simultaneously I developed the following SQL query. This merges all authors which have identical lastname and initial letter of firstname/initials. Only the author having the longest name entry survives. Please use with care!

UPDATE biblio_contributor c 
INNER JOIN 
  (SELECT t2.N, t2.cid AS newcid, t3.* FROM 
    (SELECT *, count(*) AS N FROM 
      (SELECT cid, name, CONCAT(lastname,IF(firstname<>"",LEFT(firstname,1),LEFT(initials,1))) AS namei 
       FROM biblio_contributor_data cd ORDER BY CHAR_LENGTH(name) DESC) t1 
     GROUP BY namei HAVING N>1) t2 
   INNER JOIN biblio_contributor_data t3 
   ON t2.namei=CONCAT(t3.lastname,IF(t3.firstname<>"",LEFT(t3.firstname,1),LEFT(t3.initials,1))) 
   ORDER BY t2.N DESC, t2.cid) t4 
ON c.cid=t4.cid
SET c.cid=t4.newcid

This SQL query removes obsolete authors, i.e. those which have no publications anymore. This may be a candidate for biblio_cron().

DELETE FROM biblio_contributor_data WHERE cid NOT IN (SELECT cid FROM biblio_contributor GROUP BY cid)
rjerome’s picture

I've been debating as to whether orphaned authors should be removed or not. I currently have such a thing in biblio_delete() which removes orphans, however I've been thinking that perhaps someone might want to pre-populate the database with all the faculty members so something like that which would allow the autocomplete on the form to work more effectively. So I'm thinking of leaving orphans in. What do you think?

rhaschke’s picture

Sure, that's an important argument. However, currently there is no way to remove orphans other than biblio_delete. Here also predefined authors from faculty may be removed. I propose to use another admin form showing all orphans, allowing the admin to select which ones to delete. Additionally it might be sensible to add a sticky field to biblio_contributor_data to prevent removal.

rjerome’s picture

Excellent, do you want to do that or shall I?

And yes, the author purging would have to be removed from biblio_delete for obvious reasons.

rjerome’s picture

BTW, I forgot to mention, if your wondering what the status of the multi-fieldset authors is... I have discovered an issue in parsing those .csv files, after adding the definitions for the new fields, the various author types are no longer stored in the biblio_contributor_type_data table. Given the fragility and ugliness of this code, I'm looking at alternatives (XML) for reading in this data.

rhaschke’s picture

Next week I don't have time to create the deletion form. But I can do it afterwards.

I'm not sure what you mean by the various author types are no longer stored in the biblio_contributor_type_data? Where are they stored now?
I propose not to mix these author types with other field customization. Ideally you would allow to assign several author types to a single contributor category.

rjerome’s picture

The issue I'm referring to is in the install file function _add_custom_field_data(). It reads a file called biblio.field.type.data.csv which contains the "auth_type" definitions for the various publication types and this is not functioning correctly after adding the extra contributor fields to biblio.field.link.data.csv.

rhaschke’s picture

Ok. I didn't noticed a problem when reading the contributor fields yet.

rhaschke’s picture

I started to work on the "delete orphans form".

liam morland’s picture

Issue summary: View changes
Status: Active » Closed (outdated)

This version is no longer maintained. If this issue is still relevant to the Drupal 7 version, please re-open and provide details.