PR-5.3-dev Pending

User tests: Successful: 2 exlemor, krishnaGandhi11 Unsuccessful: 0

avatar joomdonation
joomdonation
12 Mar 2025

Pull Request for Issue # .

Summary of Changes

While doing code review for PR #44885, I noticed some bad code in CategoryeditField class. This PR improves code of that class, make code cleaner and easier to read:

  • Introduce local variable $isParentCategoryField instead of repeating call code $this->element['parent'] || $jinput->get('option') == 'com_categories' everywhere when we need to check if this field is used to allow choosing parent categories.
  • Use isset($this->element['extension']) to check if the extension attribute is defined for the field. It's more cleaner than just use $this->element['extension'] in the if condition check. Similar for other code which is used to check for existence of an attribute in the field.

Testing Instructions

  • Use Joomla 5.3
  • Edit a category, and look at categories displayed in Parent field. Make sure it is the same before and after applying changes from this PR.
  • Edit an article, and look at categories displayed in Category field. Make sure it is the same before and after applying changes from this PR.

Actual result BEFORE applying this Pull Request

Works

Expected result AFTER applying this Pull Request

Works, with cleaner code, and slight faster.

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 - 12 Mar 2025
avatar joomdonation joomdonation - change - 12 Mar 2025
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 12 Mar 2025
Category Administration com_categories
avatar exlemor exlemor - test_item - 12 Mar 2025 - Tested successfully
avatar exlemor
exlemor - comment - 12 Mar 2025

I have tested this item ✅ successfully on b646306

I have tested this successfully. I will say I didn't get a sense of speed improvement but then again I was on a simple structured test website, probably more visible on a large website. Thanks @joomdonation!


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/45116.
avatar joomdonation joomdonation - change - 13 Mar 2025
Labels Added: PR-5.3-dev
avatar joomdonation
joomdonation - comment - 13 Mar 2025

I will say I didn't get a sense of speed improvement

The speed improvement is in theory only, for small change like this, it is not noticeable.

I just noticed an error in the code and fix it. Could you please help testing it again when you have time? Sorry for the inconvenience and thanks for testing @exlemor

avatar krishnaGandhi11 krishnaGandhi11 - test_item - 13 Mar 2025 - Tested successfully
avatar krishnaGandhi11
krishnaGandhi11 - comment - 13 Mar 2025

I have tested this item ✅ successfully on c57f918

Test successful: the Parent field and Category field behave the same as before.
Thanks! @joomdonation.


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

avatar exlemor exlemor - test_item - 13 Mar 2025 - Tested successfully
avatar exlemor
exlemor - comment - 13 Mar 2025

I have tested this item ✅ successfully on c57f918

I have re-tested this just now successfully. :)

Thanks, @joomdonation


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

avatar joomdonation joomdonation - change - 13 Mar 2025
Status Pending Ready to Commit
avatar joomdonation
joomdonation - comment - 13 Mar 2025

RTC. Thanks for testing @krishnaGandhi11 and @exlemor


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

Add a Comment

Login with GitHub to post a comment