-
Notifications
You must be signed in to change notification settings - Fork 14
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
Redia XML fixes #1725
Merged
Merged
Redia XML fixes #1725
Conversation
This file contains 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
The current approach is somewhat frail in regards to ensuring correct and consistent formatting. In practice it also has challenges given the fact that it requires us to ensure that our values are properly encoded. We have currently done this for the description but in practice we also need to do this for all other values. To avoid this we update the implementation to use core PHP XML Writer instead. It has a number of advantages over alternate solutions: - SimpleXML does not allow the same amount of control of the output. Example; I could not get it to add an explicit encoding attribute on the root XML element. - Third party solutions add to our dependency tree. We do not want to do this to maintain a legacy solution. The new implementation has been checked by matching it with the existing one using semantic diff'ing with difftastic. It matches 1-to-1 except for the following exception: When data is missing e.g. branch or media then the related elements are omitted instead of returning empty elements. By doing this we can drop the encoding of the description we already added.
It should be medium - not contentmedium.
Sometimes we want to display ranges of prices in situations where it is not appropriate to apply the additional formatting that we normally do (current prefix, "free" instead of 0 etc.) One example for this is the RSS feed for the Redia app. This adds support for this supported by a unit test.
Prices in the original feed are (mostly) displayed as raw integers in the format "[price]" or "[low price] - [high price]". If the event is free then there is no price element for it in the feed. Add support for similar output in the our new implementation of the feed by using the raw price range formatting.
kasperg
force-pushed
the
redia-xml-fixes
branch
from
November 6, 2024 09:24
8d9bb49
to
22623b4
Compare
rasben
approved these changes
Nov 8, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've looked through, commit by commit, and i dont have any comments in regards to the code.
I havent checked the actual feed, as I know it'll be tested by Redia
# Conflicts: # web/modules/custom/dpl_event/src/EventWrapper.php
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.
Link to issue
https://reload.atlassian.net/browse/DDFHER-117
https://reload.atlassian.net/browse/DDFHER-124
https://reload.atlassian.net/browse/DDFHER-125
Description
The current approach is somewhat frail in regards to ensuring
correct and consistent formatting.
In practice it also has challenges given the fact that it requires us
to ensure that our values are properly encoded. We have currently done
this for the description but in practice we also need to do this for
all other values.
To avoid this we update the implementation to use core PHP XML Writer
instead.
It has a number of advantages over alternate solutions:
Example; I could not get it to add an explicit encoding attribute on
the root XML element.
do this to maintain a legacy solution.
The new implementation has been checked by matching it with the
existing one using semantic diff'ing with difftastic.
It matches 1-to-1 except for the following exception: When data is
missing e.g. branch or media then the related elements are omitted
instead of returning empty elements.
By doing this we can drop the encoding of the description we already
added.
Additionally more fields from the original feed have been added.
Additional comments or questions
I recommended reviewing this commit by commit.