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

Repeater formwidget: add getLoadValue() method #1329

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

mjauvin
Copy link
Member

@mjauvin mjauvin commented Mar 15, 2025

I opened this PR to improve the code path leading to the underlying issue, and help us find a solution.

Remove redundant code by implementing getLoadValue() method.

Try to Fix #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
Copy link
Member Author

mjauvin commented Mar 15, 2025

diff --git a/modules/backend/formwidgets/Repeater.php b/modules/backend/formwidgets/Repeater.php
index feb19f10e..ad6b0734c 100644
--- a/modules/backend/formwidgets/Repeater.php
+++ b/modules/backend/formwidgets/Repeater.php
@@ -344,6 +344,8 @@ protected function makeItemFormWidget($index = 0, $groupCode = null)
    
     public function getLoadValue()
     {  
+        // this resolves the issue, but I'm guessing might break something else
+        return parent::getLoadValue();
         return ($this->loaded === true) ? post($this->formField->getName()) : parent::getLoadValue();
     }

@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

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
1 participant