https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41151

--- Comment #67 from Martin Renvoize (ashimema) 
<[email protected]> ---
Created attachment 204761
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=204761&action=edit
Bug 41151: (follow-up) Parse quoted value_str in AdditionalFieldsDisplay

The display side previously used a naive value_str.split(",") to decide
whether a repeatable additional field held multiple values. That approach
could not tell the separator between repeats apart from a comma embedded in
a single value, so "a,b,c" / "b" / "c" rendered as five lines instead of
three.

Match the new strings_map CSV-style encoding with a state-machine parser
shared between additional-fields consumers. Values with "," or '"' arrive
quoted, values without pass through untouched, and internal '""' are
folded back to a single '"'.

Add a shared composable so KohaTable can reuse the parser (and an
escapeHtml helper to keep HTML-emitting callers safe). The component now
routes every value through parseValueStr and no longer reaches into the
raw string itself.

Test plan:
  1. Create a repeatable additional field on a Vue-rendered detail view
     (e.g. ERM agreement).
  2. Set three values: "a,b,c,", "b", "c".
  3. Reload the view; confirm three lines, first intact as "a,b,c,".
  4. A single value containing a comma still renders unquoted.

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to