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

Afform - Ensure afField ids contain only allowed characters #24675

Merged
merged 1 commit into from
Oct 25, 2022

Conversation

colemanw
Copy link
Member

@colemanw colemanw commented Oct 5, 2022

Overview

Ensures the id attribute for afFields only contains characters suitable for an id.

Before

Fieldnames sometimes contain a dot (e.g. custom fields), which is not allowed in the html spec.

After

Funny characters replaced with dashes.

@colemanw
Copy link
Member Author

colemanw commented Oct 5, 2022

Test this please

@civibot
Copy link

civibot bot commented Oct 5, 2022

(Standard links)

@civibot civibot bot added the master label Oct 5, 2022
@jackgleeson
Copy link

Hey @colemanw. I can see the new js function running on the front end. However, I haven't been able to find a way to add an ID field that contains a dot or other unwanted character. Could you advise how best to test that? Thanks!

@colemanw
Copy link
Member Author

Hey @colemanw. I can see the new js function running on the front end. However, I haven't been able to find a way to add an ID field that contains a dot or other unwanted character. Could you advise how best to test that? Thanks!

Thanks for looking at this @jackgleeson - just add a custom field to the form. All APIv4 custom fields have a dot in their name. Then check the id of the <input>.

Copy link
Contributor

@kurund kurund left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me and working as expected.

ready to merge.

@colemanw colemanw merged commit 815858f into civicrm:master Oct 25, 2022
@colemanw colemanw deleted the kebab branch October 25, 2022 16:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants