Skip to content

Sensitive formwidget: add getLoadValue() method #1329

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

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

mjauvin
Copy link
Member

@mjauvin mjauvin commented Mar 15, 2025

Fixes #1321

@mjauvin mjauvin added the maintenance PRs that fix bugs, are translation changes or make only minor changes label Mar 15, 2025
@mjauvin mjauvin added this to the 1.2.8 milestone Mar 15, 2025
@mjauvin mjauvin self-assigned this Mar 15, 2025
@mjauvin mjauvin changed the title improve code readability Repeater formwidget: add getLoadValue() method Mar 15, 2025
@mjauvin
Copy link
Member Author

mjauvin commented Mar 15, 2025

I added a sensitive field to the Winter.Test plugin here to help with this: wintercms/wn-test-plugin@eacde47

@mjauvin
Copy link
Member Author

mjauvin commented Mar 18, 2025

I might have found a way to fix this in the Sensitive formWidget itself, but I need to be able to access the model's data and I'm missing something...

I need to override the getLoadValue() method of the Sensitive formWidget in order to fetch its value from the model data directly instead of its data.

@mjauvin mjauvin changed the title Repeater formwidget: add getLoadValue() method Sensitive formwidget: add getLoadValue() method Mar 18, 2025
@mjauvin
Copy link
Member Author

mjauvin commented Mar 19, 2025

@jaxwilko can you test this fix ?

Feel free to provide feedback.

@LukeTowers
Copy link
Member

LukeTowers commented Mar 19, 2025

@mjauvin I'm going to have to take a stab at fixing this myself, a FormWidget shouldn't be reaching directly into a model to grab a value, there's too many assumptions there that could go wrong.

@jaxwilko
Copy link
Member

@mjauvin I tested and this does work :)

@mjauvin
Copy link
Member Author

mjauvin commented Mar 20, 2025

@LukeTowers the RecordFinder formwidget does this as well.

@LukeTowers LukeTowers modified the milestones: 1.2.8, 1.2.9 Jun 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance PRs that fix bugs, are translation changes or make only minor changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sensitive form widget does not function correctly inside a repeater
3 participants