joomla-cms icon indicating copy to clipboard operation
joomla-cms copied to clipboard

[5.4] Remove unnecessary $this->setError('')

Open Hackwar opened this issue 4 weeks ago • 1 comments

Summary of Changes

Turns out that somehow we have very old code that by default sets an (empty) error each time we save something or publish a nested entity. This triggers the new code for useException. This removes these unnecessary commands.

Testing Instructions

codereview...

Actual result BEFORE applying this Pull Request

Everything works.

Expected result AFTER applying this Pull Request

Everything works like before.

Link to documentations

Please select:

  • [ ] Documentation link for docs.joomla.org:

  • [X] No documentation changes for docs.joomla.org needed

  • [ ] Pull Request link for manual.joomla.org:

  • [X] No documentation changes for manual.joomla.org needed

Hackwar avatar Dec 02 '25 20:12 Hackwar

I have tested this item :white_check_mark: successfully on 2b63c742f8deb4ab862c3c1271288438157315e5


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/46527.

alikon avatar Dec 05 '25 16:12 alikon

I have tested this item :white_check_mark: successfully on 2b63c742f8deb4ab862c3c1271288438157315e5


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/46527.

chmst avatar Dec 13 '25 17:12 chmst

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/46527.

chmst avatar Dec 13 '25 17:12 chmst

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/46527.

richard67 avatar Dec 13 '25 17:12 richard67

Test result:

  • ✅ Checked with find . -name \*.php | xargs /usr/bin/grep "\$this->setError[(]''[)]" only the three removed entries are found in our code (and three more in libraries/vendor/phpmailer/phpmailer/src/SMTP.php)
  • I tried to find actions by setting PR breakpoints at the three locations, but I couldn't stop at any of the three locations with xdebug. For example, I created and published articles. Therefore, I don't know what to test after applying the PR. In my opinion, system tests are sufficient in this case. Or do you have any tips?

muhme avatar Dec 14 '25 03:12 muhme

Thanks @Hackwar for this fix, and thanks @alikon , @chmst and @muhme for testing.

richard67 avatar Dec 17 '25 18:12 richard67