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

Templates use lower filter on values where it should not #82

Open
tim-s-ccs opened this issue Apr 17, 2024 · 1 comment
Open

Templates use lower filter on values where it should not #82

tim-s-ccs opened this issue Apr 17, 2024 · 1 comment

Comments

@tim-s-ccs
Copy link

Describe the bug
Within some of the templates the lower filter is used where it should not be.
The affect components are:

  • Exit this page
  • Select

In the "Exist this page" component, the lower filter is being applied to the attributes tag:

{{ attribute }}="{{ value | lower }}"{% endfor %}

As the user passes in the attributes we should not mutate what they are otherwise there could be unexpected consequences.
I realises this was required to pass a test but perhaps the test needs to be updated (can be extended as part of my work in #81)

In the "Select" component, the lower filter is being applied to the value:

<option {%- if item.value is not undefined %} value="{{ item.value | lower }}"{% endif %}

Again, as the user passes in the values we should not mutate them are otherwise there could be unexpected consequences (which is how I discovered this bug).

Expected behavior

  • The "Exit this page" component should not lower the attributes passed by the user
  • The "Subject" component should not lower the values passed by the user

Additional context
I'm happy to help and contribute to this project so if you want to make changes I can

@masuk-kazi98
Copy link

Any updates on this? We also require the removal of 'lower' from the options tag as it affects how we process the user selections for certain data sets

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

2 participants