Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closes #2547 Add ability to customize publication types. #2574

Open
wants to merge 142 commits into
base: main
Choose a base branch
from

Conversation

trackleft
Copy link
Member

@trackleft trackleft commented Jul 5, 2023

Description

Adds a new configurable entity type called 'publication type'.

Adds a core patch from a merge request on issue #3347343

Creates a mechanism where site owners can create arbitrary publication types and map them to supported types in citation style language

This way the list of types is editable for both the field on the publication content type and within views with exposed forms for filters.

Adds a new configuration entity for each supported type. See the article type as an example

Related issues

Closes #2547

How to test

Enable az_publication
Add a new publication
Select Article in Book as the type.
See what happens.

Types of changes

Arizona Quickstart (install profile, custom modules, custom theme)

  • Patch release changes
    • Bug fix
    • Accessibility, performance, or security improvement
    • Critical institutional link or brand change
    • Adding experimental module
    • Update experimental module
  • Minor release changes
    • New feature
    • Breaking or visual change to existing behavior
    • Upgrade experimental module to stable
    • Enable existing module by default or database update
    • Non-critical brand change
    • New internal API or API improvement with backwards compatibility
    • Risky or disruptive cleanup to comply with coding standards
    • High-risk or disruptive change (requires upgrade path, risks regression, etc.)
  • Other or unknown
    • Other or unknown

Drupal core

  • Patch release changes
    • Security update
    • Patch level release (non-security bug-fix release)
    • Patch removal that's no longer necessary
  • Minor release changes
    • Major or minor level update
  • Other or unknown
    • Other or unknown

Drupal contrib projects

  • Patch release changes
    • Security update
    • Patch or minor level update
    • Add new module
    • Patch removal that's no longer necessary
  • Minor release changes
    • Major level update
  • Other or unknown
    • Other or unknown

Checklist

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Allows changing the filter from something like.
Screenshot 2024-10-22 at 2 38 08 PM
To a more manage-able
image

@trackleft trackleft added the enhancement New feature or request label Jul 5, 2023
@trackleft trackleft changed the title Closes #2547 Let's see what this breaks. Closes #2547 Add Article in Book publication type. Jul 5, 2023
@trackleft
Copy link
Member Author

Looks like this PR works as expected, with no change in the output, and just an additional option in field_az_publication_type and we can filter on it in the search view.

@trackleft trackleft marked this pull request as ready for review July 5, 2023 22:14
@trackleft trackleft requested a review from a team as a code owner July 5, 2023 22:14
@trackleft trackleft added the patch release Issues to be included in the next patch release label Jul 5, 2023
@tadean
Copy link
Contributor

tadean commented Jul 5, 2023

The options currently listed for the type are from the Citation Style Language Standard. This type field is used to determine what special cases are used in the style rendering. I'm not sure if this will cite books correctly...I think many styles will treat this as a generic type that doesn't meet any of the checks for types that have specific rules associated with them.

Are the publications in question a collection/anthology? Those are typically cited as Book but with a container (Ordinarily books do not have a container)

I've wondered if maybe we need a layer of abstraction from the types a visitor sees versus what's presented to the CSL processing (perhaps a taxonomy vocabulary that lists what types are available on the site, with a field for a mapping for what CSL type they actually use). This would allow for arbitrary names for the publication types maybe...

@joeparsons joeparsons added the needs discussion Further discussion required to determine requirements label Aug 4, 2023
@trackleft trackleft changed the title Closes #2547 Add Article in Book publication type. Closes #2547 Add ability to customize type label. Dec 12, 2023
@trackleft trackleft changed the title Closes #2547 Add ability to customize type label. Closes #2547 Add ability to customize types. Dec 12, 2023
@trackleft trackleft changed the title Closes #2547 Add ability to customize types. Closes #2547 Add ability to customize publication types. Dec 12, 2023
@trackleft trackleft marked this pull request as draft December 12, 2023 18:02
@trackleft
Copy link
Member Author

bberndt-uaz
bberndt-uaz previously approved these changes Oct 25, 2024
composer.json Outdated Show resolved Hide resolved
bberndt-uaz
bberndt-uaz previously approved these changes Oct 31, 2024
if (!empty($cslItem->additionalLinks)) {
$renderedText .= ' ' . $cslItem->additionalLinks;
}
return preg_replace('#<div class="csl-left-margin">(.*?)</div>#', '', $renderedText);
$dom = new DOMDocument();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does switching to DOM-based parsing here resolve an issue with the current regex-based parsing?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure anymore, but line 309 says not to parse HTML with regex.

@@ -620,7 +624,7 @@ display:
admin_label: 'field_az_authors: Author'
plugin_id: standard
required: false
use_ajax: true
use_ajax: false
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this an intended change?

@tadean
Copy link
Contributor

tadean commented Nov 1, 2024

Currently in the view, it seems like field_az_publication_mapped_type_target_id is showing up as a broken handler:

image

@tadean
Copy link
Contributor

tadean commented Nov 1, 2024

Currently in the view, it seems like field_az_publication_mapped_type_target_id is showing up as a broken handler:

This was a local build problem for me, disregard sorry. I was testing the database update by upgrading a site from a previous version and composer hadn't yet applied the patch for the entityreference filter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation editor experience Improvements to the editor experience for individuals editing Quickstart websites enhancement New feature or request needs discussion Further discussion required to determine requirements patch release Issues to be included in the next patch release
Projects
Status: Ready to merge
Development

Successfully merging this pull request may close these issues.

Add ability to customize publication types.
4 participants