Skip to content

[5.3] onContentPrepareForm should return void instead of boolean#44817

Merged
laoneo merged 1 commit intojoomla:5.3-devfrom
joomdonation:onContentPrepareForm_Return_Void
Feb 4, 2025
Merged

[5.3] onContentPrepareForm should return void instead of boolean#44817
laoneo merged 1 commit intojoomla:5.3-devfrom
joomdonation:onContentPrepareForm_Return_Void

Conversation

@joomdonation
Copy link
Contributor

Pull Request for Issue # .

Summary of Changes

While review code of the already merged PR #43426, I found a small issue with the code. The onContentPrepareForm method of ConfirmConsent class should not return boolean value, it should return void instead, like in the System - Fields plugin code https://github.com/joomla/joomla-cms/blob/5.3-dev/plugins/system/fields/src/Extension/Fields.php#L247

In general, when converting our plugins to use SubscriberInterface, the event listeners should always return void. If we need to pass result back, use $event->addResult method instead of return command

Testing Instructions

Code review should be enough

Actual result BEFORE applying this Pull Request

Works

Expected result AFTER applying this Pull Request

Works

Link to documentations

Please select:

  • Documentation link for docs.joomla.org:

  • No documentation changes for docs.joomla.org needed

  • Pull Request link for manual.joomla.org:

  • No documentation changes for manual.joomla.org needed

@laoneo laoneo added this to the Joomla! 5.3.0 milestone Feb 4, 2025
@laoneo
Copy link
Member

laoneo commented Feb 4, 2025

Thank you!

@laoneo laoneo merged commit 8ea8a08 into joomla:5.3-dev Feb 4, 2025
2 of 3 checks passed
@joomdonation
Copy link
Contributor Author

Thanks @laoneo for the quick merge !

@joomdonation joomdonation deleted the onContentPrepareForm_Return_Void branch February 4, 2025 15:54
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.

3 participants