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

Fields seem to cause errors if the "Field ID" includes a "."? #2882

Closed
sleidig opened this issue Feb 27, 2025 · 4 comments · Fixed by #2884
Closed

Fields seem to cause errors if the "Field ID" includes a "."? #2882

sleidig opened this issue Feb 27, 2025 · 4 comments · Fixed by #2884
Assignees
Labels
released on @master managed by CI (semantic-release) released managed by CI (semantic-release)

Comments

@sleidig
Copy link
Member

sleidig commented Feb 27, 2025

Certain Field IDs cause errors.

To Reproduce
Steps to reproduce the behavior:

  1. Edit data structure of an entity type
  2. Add a new field, change the "Field ID" manually and add a "." character
  3. Save and open the details view to see the form field
  4. In the console errors are shown:

dynamic-component.directive.ts:69 TypeError: Cannot read properties of null (reading 'parent')
at _.ngOnInit (edit-component.ts:70:36)
at dynamic-component.directive.ts:69:25
at Generator.next ()

TypeError: Cannot read properties of null (reading '_rawValidators')
at template (edit-text.component.html:5:21)

...

ToDo:

investigate:

  • Are there other special characters that also cause such errors?
    • Check what happens if the user uses Arabic or other characters in the Field ID manually
  • Check what the system generates as ID when filling the label with other scripts like Hindi or Arabic characters

implement a fix:

  • Validate the input (using our regex validator function?) of that field
@george-neha
Copy link

  1. for some of the special characters like . & @ %, the system generates an error like the one mentioned above.
  2. if unique character . is added in the field ID, then that field is always editable.
Image
  1. Field ID is blank if other scrips like Hindi, Urdu, etc are used. The field is populated only if the characters are in the English script.
Image

@sleidig
Copy link
Member Author

sleidig commented Feb 27, 2025

Thanks @george-neha , that's super helpful analysis 🙏

I think we should only allow alphanumeric characters and _ in IDs, to avoid any possible issues (i.e. probably a regex like this ^[a-zA-Z0-9_]*$). And update the AdminEntityFieldComponent with its "Field ID" form control in two ways:

  1. update the generation of IDs (generateIdFromLabel) to replace any other special character with an underscore (if such characters are still present after the currently implemented transformation from text to ID, which I would leave as is)
  2. add a validator to that form control to mark any value that includes other characters as invalid (e.g. when the user directly changes the field's value)

@Abhinegi2 Abhinegi2 moved this from Planned (current "sprint") to Functional Review in All Tasks & Issues Feb 28, 2025
@github-project-automation github-project-automation bot moved this from Functional Review to Done in All Tasks & Issues Feb 28, 2025
@aam-digital-ci
Copy link
Collaborator

🎉 This issue has been resolved in version 3.47.0-master.5 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@aam-digital-ci aam-digital-ci added the released on @master managed by CI (semantic-release) label Feb 28, 2025
@aam-digital-ci
Copy link
Collaborator

🎉 This issue has been resolved in version 3.47.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@aam-digital-ci aam-digital-ci added the released managed by CI (semantic-release) label Feb 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
released on @master managed by CI (semantic-release) released managed by CI (semantic-release)
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

4 participants