In "Authors" you can assign a role to all contributors. Regardless of which role I assign, contributors will still appear as Authors, which is wrong. As far as I can see, there's no function yet to show the role of authors. I would expect a table row for each role with the assigned contributors.
I would also suggest to rename the tab "Authors" in the edit menu to "Contributors".
In the attached images you can see how I assigned two contributors, one as author, the other as editor and that they appear as Authors in the table. They will also appear as authors in the Citation.
| Comment | File | Size | Author |
|---|---|---|---|
| #22 | chicago_author_date.xml_.txt | 21.09 KB | antongp |
| #9 | Screenshot 2019-08-01 at 4.03.05 PM.png | 63.13 KB | u_tiwari |
| #9 | Screenshot 2019-08-01 at 3.59.48 PM.png | 38.8 KB | u_tiwari |
| bibcite_show_contributors.png | 11.58 KB | plepe | |
| bibcite_edit_contributors.png | 47.21 KB | plepe |
Comments
Comment #2
antongp commentedComment #3
plepe commentedI now somehow solved this issue by creating fields for Editors and Advisors (we don't need other roles) and copying the data in the database. This might not be the best solution, but I wanted to share mine, as long as there's no other.
You can find code changes in the attachment, these are the database queries:
CREATE TABLE `bibcite_reference__editor` ( `bundle` varchar(128) CHARACTER SET ascii NOT NULL DEFAULT '' COMMENT 'The field instance bundle to which this row belongs, used when deleting a field instance', `deleted` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'A boolean indicating whether this data item has been deleted', `entity_id` int(10) unsigned NOT NULL COMMENT 'The entity id this data is attached to', `revision_id` int(10) unsigned NOT NULL COMMENT 'The entity revision id this data is attached to, which for an unversioned entity type is the same as the entity id', `langcode` varchar(32) CHARACTER SET ascii NOT NULL DEFAULT '' COMMENT 'The language code for this data item.', `delta` int(10) unsigned NOT NULL COMMENT 'The sequence number for this data item, used for multi-value fields', `editor_target_id` int(10) unsigned NOT NULL COMMENT 'The ID of the target entity.', `editor_category` varchar(255) DEFAULT NULL, `editor_role` varchar(255) DEFAULT NULL, PRIMARY KEY (`entity_id`,`deleted`,`delta`,`langcode`), KEY `bundle` (`bundle`), KEY `revision_id` (`revision_id`), KEY `editor_target_id` (`editor_target_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Data storage for bibcite_reference field editor.'; CREATE TABLE `bibcite_reference__advisor` ( `bundle` varchar(128) CHARACTER SET ascii NOT NULL DEFAULT '' COMMENT 'The field instance bundle to which this row belongs, used when deleting a field instance', `deleted` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'A boolean indicating whether this data item has been deleted', `entity_id` int(10) unsigned NOT NULL COMMENT 'The entity id this data is attached to', `revision_id` int(10) unsigned NOT NULL COMMENT 'The entity revision id this data is attached to, which for an unversioned entity type is the same as the entity id', `langcode` varchar(32) CHARACTER SET ascii NOT NULL DEFAULT '' COMMENT 'The language code for this data item.', `delta` int(10) unsigned NOT NULL COMMENT 'The sequence number for this data item, used for multi-value fields', `advisor_target_id` int(10) unsigned NOT NULL COMMENT 'The ID of the target entity.', `advisor_category` varchar(255) DEFAULT NULL, `advisor_role` varchar(255) DEFAULT NULL, PRIMARY KEY (`entity_id`,`deleted`,`delta`,`langcode`), KEY `bundle` (`bundle`), KEY `revision_id` (`revision_id`), KEY `advisor_target_id` (`advisor_target_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Data storage for bibcite_reference field advisor.'; insert into bibcite_reference__editor (select bundle, deleted, entity_id, revision_id, langcode, delta, author_target_id, author_category from bibcite_reference__author where author_role='editor'); insert into bibcite_reference__advisor (select bundle, deleted, entity_id, revision_id, langcode, delta, author_target_id, author_category from bibcite_reference__author where author_role='advisor'); delete from bibcite_reference__author where author_role in ('editor', 'advisor');Things todo: Remove the 'role' column from the new tables.
Comment #4
antongp commentedComment #5
u_tiwari commentedThis issue with all roles being treated as Author even if Editor is selected still exists in alpha-10 and dev version, is there any plan to roll out this patch or any other fix for this is already in place?
Comment #6
u_tiwari commentedThis fixes the issue of all roles being treated as author always because of fixed contributorKey in `bibcite_entity.normalizer.reference` service.
Seems to work fine with citeproc.
Comment #7
u_tiwari commentedComment #8
antongp commentedHi @u_tiwari
Original issue is about different thing, not about what you're trying to fix by patch #6. There is issue report already related to roles/category problem on import: #3069985: Endnote import: author category/role. But the problem is actually more general and affects some other formats, not only EndNote, and affects export as well. So, fix for that issue has to be more general and probably will include new mapping settings.
Re. original issue: patch #3 is not the right way, we're not going to add new base fields to the Reference entity type to fix this. I think there'll be individual fix for Table view only, on theming level (preprocess hook + template). For more general case, we'll probably add more formatters for Contributor field type which will provide more flexibility, but not sure for now.
Thanks.
Comment #9
u_tiwari commentedThanks for the reply. This patch has more to do with citation view mode display for `csl` format. When the citation is rendered on Entity view page we get this array where editor key is empty and gets included in authors

And if applying that patch we get the correct author types with desired keys
I agree we might need more work on this but this seemed a simple fix for citation view mode.
Comment #10
antongp commentedAh, yes, you're right. Citation output is also affected since it uses serialization as well. But table output and citation output will be fixed in different ways, and citation problem is more general and there are a few more issues related at some degree.
Thanks!
Comment #11
jrochate commentedHi.
I had to adapt the patch in #6 to test for empty $author['role'] because prior to saving after patch this info is not available and we stick to the default method of $attributes[$this->contributorKey] = $authors;
I'm not sending the patch to not confuse future users, because this does not happen when we save new records AFTER this patch.
But existing information may be need to be checked and default to previous condition that this patch removes.
thanks.
This is important stuff, because without it the CSL doesn't process authors and editores correctly,
Comment #12
robcast commentedI also applied @u_tiwari's patch in #6 and now the editor of a chapter in an edited book is no longer shown as author in the CSL output.
It is still missing the "ed." it should get according to the chicago style.
@antongp: it seems you are saying that this is the wrong way to fix it. Is there a better way?
Thanks
Comment #14
antongp commentedPushed a hotfix. Mapping is hardcoded for now, but should help with editors and some other roles.
@robcast
With the hotfix, it's still missing for me with Chicago on clean installation. But American Medical Association style has it. I achieved "ed." with Chicago by editing "secondary-contributors" macro in the CSL (by setting form="short" instead of verb on label), though still not sure if it's an issue with the CSL style or processor library.
Comment #15
robcast commented@antongp thanks for the quick fix!
I do have a problem when I try to use the latest 1.x-dev though:
Could it be a problem with my installation? When I try to do the "drush updb" I get an error:
Comment #16
antongp commentedWhich Drupal core version do you use? Seems like not newer than 8.6.x , because EntityNormalizer::__construct() signature change as well as EntityDefinitionUpdateManager::updateFieldableEntityType() method addition happened in Drupal 8.7.0.
We basically keep latest dev compatible with supported Drupal core versions, i.e. Drupal 8.7.x and 8.8.x at the moment, compatibility with unsupported versions is not guaranteed. Fun fact: there are a few workarounds in the code already to make the module compatible with both supported Drupal core branches (these workarounds can be removed once Drupal 8.9/9.0 is released). BibCite alpha10 should be compatible with Drupal 8.6, 8.7 and 8.8.
Hope this helps.
Comment #17
robcast commented@antongp sorry, I didn't specify my Drupal version. Yes it's 8.6.
I am working on the upgrade to 8.7 and I'll try again.
Comment #18
robcast commented@antongp I am on 8.7.11 now and I can install bibcite-1.x and it works!
The editor is recognized by the CSL now. I have to try out your fix to get the "ed." into Chicago style...
Can I use the current bibcite-1.x in low-volume production, or are there known issues?
Thanks!
Comment #19
antongp commentedI believe there are no new issues added in latest dev in comparison with alpha10. I would start with latest dev because of all nice changes happened since alpha10 (revisions support, UI improvements, etc... You can find full list of changes in the changelog https://git.drupalcode.org/project/bibcite/blob/8.x-1.x/CHANGELOG.md)
Comment #20
robcast commented@antongp I am using 1.x-dev now and it works well!
Thanks a lot!
Comment #21
robcast commented@antongp in #14 you mentioned that you have been able to get the Chicago style to insert "ed." for the editor of a book chapter.
I tried to replicate your fix by changing the label in the secondary-contributors macro but it does not work for me. I have the editor as category=secondary and role=editor.
Could you post the patched style?
The "ed." does work with the AMA style, as you noted.
Thank you.
Comment #22
antongp commented@robcast sorry for late response. Attached edited chicago_author_date style markup. I edited "secondary-contributors" macro.
Comment #23
robcast commentedThanks @antongp! Your style did not exactly what I wanted (editor for chapter type as secondary author) but it showed me that it could work and I found that I needed to change the "verb" in "container-contributors" instead :-)
Comment #24
mark_fullmerThis appears to be working as designed in the 3.0.x release. Is anyone still having an issue with how different types of contributors are rendered? Can we close this as outdated?
Comment #25
mark_fullmerComment #26
mark_fullmer