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

Fix edition details #528

Merged
merged 2 commits into from
Jan 15, 2025
Merged

Fix edition details #528

merged 2 commits into from
Jan 15, 2025

Conversation

peterstadler
Copy link
Member

Description, Context and related Issue

The function edition:details($uri)?name would return an element node instead of a string value, thus the endpoint getEdition.xql returns e.g. "name" : "<editionName xmlns=\"http://www.edirom.de/ns/1.3\">Pintos-Edirom von Salome Obert</editionName>" (among other properties).

This PR fixes this to return only the string value and refactors another function to not duplicate code.

Steps to reproduce

Check the Ajax request to getEdition.xql which is loaded at every star of the Edirom:
Bildschirmfoto 2025-01-14 um 18 41 29
(The screenshot already displays the fixed version)

How Has This Been Tested?

With the Pintos data

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • Improvement
  • Refactoring

Overview

  • I have updated the inline documentation accordingly.
  • I have performed a self-review of my code, according to the style guide
  • I have read the CONTRIBUTING document.
  • All new and existing tests passed.

apply string normalization to enforce a string value to be returned (instead of an element node).
to not duplicate code this function now simply points at `edition:details($uri)?name`
@peterstadler peterstadler added this to the 1.0.0 milestone Jan 14, 2025
@peterstadler peterstadler added Type: bugfix A pull request providing a bugfix Area: XQuery labels Jan 14, 2025
@krHERO krHERO self-requested a review January 15, 2025 09:21
Copy link
Member

@krHERO krHERO left a comment

Choose a reason for hiding this comment

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

thanks for the fix. i tested with pintos before and after your changes to the code. it works fine.

bug
Bildschirmfoto 2025-01-15 um 10 16 34

after the fix
Bildschirmfoto 2025-01-15 um 10 21 10

@peterstadler
Copy link
Member Author

Vielen Dank für das review @krHERO !

@peterstadler peterstadler merged commit 7d9dbe5 into develop Jan 15, 2025
5 checks passed
@peterstadler peterstadler deleted the fix-edition-details branch January 15, 2025 09:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: XQuery Type: bugfix A pull request providing a bugfix
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants