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

datatable formwidget within a translatable repeater clears values on locale switch #33

Open
der-On opened this issue May 13, 2022 · 8 comments

Comments

@der-On
Copy link
Contributor

der-On commented May 13, 2022

If there is a datatable formwidget within a mlrepeater it does not send it's values over POST when switching locale.

The reason is that the table widget listens to a postback handler with the name onSave by default and only attaches the table values to the request if this ajax handler is used.

The solution is to temporary set the handler to the onSwitchItemLocale when the locale is beeing changed.

@bennothommo
Copy link
Member

@der-On TBH, I would rather a fix that changes the Table widget to provide its data at all times, not just on a specific AJAX callback. The callback is more for tables that use server side data storage, essentially operating independently from the form. When the table is used normally (entirely client side), its data should be sent through the POST like any other field.

This particular change is probably a little too abstract and "hacky" to accept as it is.

@der-On
Copy link
Contributor Author

der-On commented May 13, 2022

@bennothommo No problem. Then I'll wait for the fix in the Table widget and use my fork until then. Will you provide the fix in the backend module or should I do a PR for that?

@LukeTowers
Copy link
Member

@der-On if you could provide a PR for that then that would be the best way forward; we're currently very busy on a number of complex projects (Laravel 9 finalizations, static analysis, search plugin, tailwind UI skin, new website / marketplace, etc - all in addition to our regular day jobs) so the best we could do for you is provide code review on your requested changes.

@der-On
Copy link
Contributor Author

der-On commented May 14, 2022

@LukeTowers Sure no problem. Thank for your faith. Happy to help.

@der-On
Copy link
Contributor Author

der-On commented May 16, 2022

@bennothommo @LukeTowers Where exactly can I provide a PR for the backend module? The repository on github says it's a "read only mirror".

@mjauvin
Copy link
Member

mjauvin commented May 16, 2022

@der-On You need to clone winter/winter into your repo, then create a branch in your repo for this PR.

Once this is done, you need to create a PR from github to Winter's repo against your repo.

@LukeTowers
Copy link
Member

@der-On the wintercms/winter repository.

@der-On
Copy link
Contributor Author

der-On commented May 18, 2022

@LukeTowers @bennothommo PR is now here: wintercms/winter#560

@mjauvin mjauvin changed the title datable formwidget within a translatable repeater clears values on locale switch datatable formwidget within a translatable repeater clears values on locale switch Mar 16, 2024
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

Successfully merging a pull request may close this issue.

4 participants