Feature PR-6.1-dev Pending

User tests: Successful: Unsuccessful:

avatar joomdonation
joomdonation
28 Feb 2025

Pull Request for Issue # .

Summary of Changes

The loadForm method from FormBehaviorTrait (which is used by our models) always return a Form object on success and throw Exception on failure, so all empty($form) check in our model classes are useless, it never returns false, thus should be moved from models code.

Testing Instructions

This will require careful code review from our testers and maintainer.

Actual result BEFORE applying this Pull Request

Works

Expected result AFTER applying this Pull Request

Works, slight faster because the useless code is removed, thus not being executed.

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

avatar joomdonation joomdonation - open - 28 Feb 2025
avatar joomdonation joomdonation - change - 28 Feb 2025
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 28 Feb 2025
Category Administration com_associations com_banners com_categories com_config com_contact com_content com_fields com_finder com_installer com_languages com_media com_menus com_messages com_modules com_newsfeeds com_plugins com_redirect
avatar joomdonation joomdonation - change - 28 Feb 2025
Title
Remove useless empty ($form) check
[5.3] Remove useless empty ($form) check
avatar joomdonation joomdonation - edited - 28 Feb 2025
avatar joomdonation joomdonation - change - 1 Mar 2025
Labels Added: PR-5.3-dev
avatar exlemor
exlemor - comment - 23 Aug 2025

@joomdonation Can you please provide testing instructions - how can we test this? - 58 files in code review may not be enough.

Love to include it in PBF which is today :)

avatar joomdonation
joomdonation - comment - 23 Aug 2025

Thanks @exlemor. This is too late to be included in 5.3, so please ignore it for now. I will try to make it for Joomla 6 later.

avatar HLeithner
HLeithner - comment - 15 Oct 2025

This pull request has been automatically rebased to 5.4-dev.

avatar HLeithner
HLeithner - comment - 15 Oct 2025

This pull request has been automatically rebased to 6.1-dev.

avatar HLeithner HLeithner - change - 24 Nov 2025
Title
[5.3] Remove useless empty ($form) check
[6.1] Remove useless empty () check
avatar HLeithner HLeithner - edited - 24 Nov 2025
avatar HLeithner
HLeithner - comment - 24 Nov 2025

@joomdonation would you be so kind and fix the conflict, I plan this for 6.1

avatar joomdonation joomdonation - change - 24 Nov 2025
Labels Added: Feature PR-6.1-dev
avatar HLeithner HLeithner - change - 28 Nov 2025
Labels Removed: PR-5.3-dev
avatar tecpromotion tecpromotion - change - 29 Nov 2025
Status Pending Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2025-11-29 12:10:25
Closed_By tecpromotion
avatar tecpromotion tecpromotion - close - 29 Nov 2025
avatar tecpromotion tecpromotion - merge - 29 Nov 2025
avatar tecpromotion
tecpromotion - comment - 29 Nov 2025

Thanks @joomdonation for this PR.

avatar LadySolveig LadySolveig - change - 29 Nov 2025
Title
[6.1] Remove useless empty () check
[6.1] Remove useless empty () check #
avatar LadySolveig LadySolveig - edited - 29 Nov 2025
avatar joomdonation
joomdonation - comment - 2 Dec 2025

Thanks for reviewing and merging the PR. I had another look at our code again and see that the way we handle error when calling method is in-consistent:

  • Some tries to handle the case it return false (which does not really happen)
  • And most of the times, the caller code does not care/handle error at all (mean the Exception not handled and leave it to global error handler to handle)

So what should we do the caller side? Remove the code which handles false return ?

Add a Comment

Login with GitHub to post a comment