Repository navigation
[BUGFIX] Render Typolinks in publications exports - #92
Merged
Merged
Conversation
YKWeyer
force-pushed
the
bugfix/url-export
branch
from
November 10, 2026 16:40
260905a to
699884e
Compare
tinzog
added a commit
that referenced
this pull request
Nov 12, 2026
…export Follow-up to #92, which renders typolinks in the BibTeX and XML exports. - Move link resolution from the controller into the new PublicationExportService. It resolves web_url, web_url2 and file_url with the LinkFactory to absolute URLs and returns the export properties per publication uid, so the publication entities are no longer modified. The templates read {exportProperties.{publication.uid}}. - Resolve every value of the link fields, not only t3:// links, so page uids and fileadmin paths become absolute URLs as well. Omit a link field if the link cannot be resolved (hidden or deleted page, missing file) instead of exporting the raw t3:// value. - Name the link fields explicitly instead of reading typolink columns from the TCA, and create a content object if the request has none. - Escape all values and author names in the XML export. Resolved URLs with parameters and titles containing "&" produced invalid XML. Related: #94 Related: https://projekte.in2code.de/issues/85318
Contributor
|
Thanks a lot for this PR, @YKWeyer! You asked whether to do this in the controller or in the template. We went with a third option, a domain service, and added two follow-up commits on top of your merged change:
What changed:
Thanks again for the contribution! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue
When generating a BibTex or XML export, link fields are returned as they are stored in the database. Sometimes, it results in invalid URLs, especially when backend editors have used the link browser to link to local pages or files:
Suggested changes
Extend the Controller to render all internal links when calling download Actions.
An other option would have been to edit the templates (
DownloadBibtex.xmlandDownloadXml.xml) to add special cases for URL fields (file_url,web_urlandweb_url2) and render the links there. I personnaly found it more flexible and understandable to do it within the Controller, but I can change it if you prefer to do it in the template.Resolves #94