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

Store multiline in Yaml data file from a textarea form field #20

Closed
masetto opened this issue Sep 23, 2017 · 1 comment
Closed

Store multiline in Yaml data file from a textarea form field #20

masetto opened this issue Sep 23, 2017 · 1 comment

Comments

@masetto
Copy link

masetto commented Sep 23, 2017

I have an error when I store a multiline from a textarea form field, because in Yaml data file the textarea field has stored without > or | and indentation for each row.
I suggest to modify line 6 of forms/data.txt.twig from:

{{- field.name ?? index }}: {{ string((value is iterable ? value|json_encode : value)) ~ "\r\n" }}

To:

{{- field.name ?? index }}: {{ string((value is iterable ? value|json_encode : ("\n" in value ? (">\r\n  " ~ value|replace({"\n": "\n  "})) : value))) ~ "\r\n" }}

Perhaps it is better to create a specific twig file to perform this.

@hughbris
Copy link
Contributor

hughbris commented Nov 7, 2017

Just found this here! Reported it and submitted a PR two days ago in form plugin repo.

Also seems a duplicate of old bug #2 here, which is closed for some reason.

@w00fz w00fz closed this as completed Jan 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants