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

[BUG] The advanced settings editor mangles the values passed to "OTHER_COURSE_SETTINGS" #1243

Open
felipemontoya opened this issue Aug 30, 2024 · 2 comments

Comments

@felipemontoya
Copy link
Member

I found a hidden behavior in the advanced settings editor that I think is very damaging to extension builders.

where

This was tested in a tutor-nightly environment created today.

There is a setting called "Other course settings" that is turned off by default. It requires that one sets:

FEATURES["ENABLE_OTHER_COURSE_SETTINGS"] = True

In the non mfe-editor it looks like this
image

In the MFE version, it is present when the FEATURE is on. It looks a bit different, but that is not an issue:
image

what

The real issue is that it mangles the data.
If I save this:
image

It becomes:
image

Basically the editor, turned CONSTANT_CASE into camelCase.

The API returned the original CONSTANT_CASE:
image

But the rendered changed it.

If I edit the box again and save, the values will be updated at the backend in the mangled state.
image

@bra-i-am
Copy link
Contributor

bra-i-am commented Aug 30, 2024

hi, here is the place where the keys are shifted to camelCase and the behavior is happening with absolutely all the keys even if they are inside an Array

https://github.com/openedx/frontend-app-course-authoring/blob/735d978894c2548b1af21cb32d508b091182e692/src/advanced-settings/data/api.js#L18

image

@felipemontoya
Copy link
Member Author

Hi @PKulkoRaccoonGang, do you know if there was a requirement for the camelCase transformation?

The quick fix would be to exclude the other_course_settings from the camelCase cast, however this might be impacting other settings as well that expect a specific value in the backend.

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