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

Error when saving form with multicheckbox #67

Open
SimonMayr opened this issue Nov 15, 2023 · 0 comments
Open

Error when saving form with multicheckbox #67

SimonMayr opened this issue Nov 15, 2023 · 0 comments

Comments

@SimonMayr
Copy link

Hello everyone,

when submitting a form with a multicheckbox the following error is thrown: htmlspecialchars(): Argument 1 ($string) must be of type string, array given in /frp_form_answers/Classes/Domain/Finishers/SaveFormToDatabaseFinisher.php line 133
The following code worked for me and might be a suggestion for a potential fix:

if (is_array($valuesWithPages[$pageElem->getIdentifier()])) {
    $values[$pageElem->getIdentifier()]['value'] = htmlspecialchars(implode(' | ', $valuesWithPages[$pageElem->getIdentifier()]));
} else {
    $values[$pageElem->getIdentifier()]['value'] = htmlspecialchars($valuesWithPages[$pageElem->getIdentifier()]);
}
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

1 participant