🐛 Fix trailing separator in string_links for single-value fields#1718
Open
floroks wants to merge 1 commit into
Open
🐛 Fix trailing separator in string_links for single-value fields#1718floroks wants to merge 1 commit into
floroks wants to merge 1 commit into
Conversation
c5f79e9 to
ad03c33
Compare
Member
|
May I ask for a test? |
ad03c33 to
2a79acd
Compare
Author
added a test, not sure if the test documentation referring to the original issue is acceptable, or a new issue should be created. the test however fails if the code is reverted, so it seems to be working perfectly fine. another future extension could be making the separator configurable, not a huge fan of the semicolon |
When a string_links field contained a single value, a trailing separator "; " was incorrectly rendered because len(data) checked the string length instead of the list length. Changed to len(data_list). Added a regression test that verifies single-value string_links fields render without a trailing separator.
2a79acd to
c4906c1
Compare
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.
The separator condition used len(data) which refers to the original string length instead of len(data_list) which is the split list. This caused a trailing "; " to always appear after single-value fields when needs_string_links is configured.
Added a regression test that verifies single-value string_links fields render without a trailing separator.
--
Florian Roks <florian.roks@mercedes-benz.com>, Mercedes-Benz Tech Innovation GmbH
Provider Information