Skip to content

Fix "Back Button Works Only on First Form When Multiple Forms Exist"#95

Merged
Toflar merged 3 commits into
terminal42:mainfrom
timlg07:main
Nov 3, 2025
Merged

Fix "Back Button Works Only on First Form When Multiple Forms Exist"#95
Toflar merged 3 commits into
terminal42:mainfrom
timlg07:main

Conversation

@timlg07

@timlg07 timlg07 commented Oct 21, 2025

Copy link
Copy Markdown
Contributor

Closes #94

@Toflar Toflar left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey, sorry for being late to the party. I was busy not being close to any computer 😉

Logic looks good to me but I think we don't need the BC handling for mp_form_pageswitch to be honest. This form field name shouldn't be added manually anywhere and if it was, I don't see why this would be API.

So I guess I'd just add a FormManager::getPageSwitchFormFieldName() and use this everywhere. What do you think?

@timlg07

timlg07 commented Oct 28, 2025

Copy link
Copy Markdown
Contributor Author

I completely agree.
But I didn't want to break anything, and since I wasn't able to run the tests locally when I tried it, I didn't want to change them.

I now implemented your suggestion using the additional FormManager method, removed the BC for the tests, and changed them. Can you verify that the tests still work?

@timlg07 timlg07 requested a review from Toflar October 28, 2025 22:42
Comment thread src/EventListener/CompileFormFieldsListener.php Outdated
Comment thread src/Widget/Placeholder.php Outdated
Comment thread tests/EventListener/PrepareFormDataListenerTest.php
@timlg07

timlg07 commented Nov 2, 2025

Copy link
Copy Markdown
Contributor Author

Thanks for the review! I implemented your suggestions :)

@timlg07 timlg07 requested a review from Toflar November 2, 2025 17:48
@Toflar Toflar merged commit 57aee40 into terminal42:main Nov 3, 2025
7 checks passed
@Toflar

Toflar commented Nov 3, 2025

Copy link
Copy Markdown
Member

Thank you @timlg07! ❤️

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 this pull request may close these issues.

Back Button Works Only on First Form When Multiple Forms Exist

2 participants