? ? Pending

User tests: Successful: Unsuccessful:

avatar csthomas
csthomas
16 Mar 2017

Improvement for PR #9739

Summary of Changes

Do not load language column separately for each <option> in <select> field - JFormFieldCategory.
Instead do this once in JHtmlCategory.

Testing Instructions

Joomla should works as before.
Before test you have to have a few categories (at least a few multi languages) for articles.
Enable debug mode.

Go to edit some menu item (or articles view) in backend.
Check what categories you have in search field Category - some of them should have suffix like " (en-GB)".
Check number of queries in debug position at the bottom of page.
Find queries which look like "SELECT language FROM #__categories WHERE ...".
If you have 50 categories for articles then you will see 50 queries like above.

Apply patch.
The above queries disappear.
Joomla will still (as before) show category title with language code in brackets if language is not set as All.

Expected result

Not too many queries related to category field.

Actual result

If you have 100 categories for articles then joomla adds 100 additional simple queries for each category item (<option>) in form field.

Documentation Changes Required

None.

avatar csthomas csthomas - open - 16 Mar 2017
avatar csthomas csthomas - change - 16 Mar 2017
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 16 Mar 2017
Category Libraries
avatar csthomas csthomas - change - 16 Mar 2017
Labels Added: ?
avatar csthomas csthomas - change - 30 Mar 2017
The description was changed
avatar csthomas csthomas - edited - 30 Mar 2017
avatar NunoLopes96 NunoLopes96 - test_item - 12 Apr 2017 - Tested successfully
avatar NunoLopes96
NunoLopes96 - comment - 12 Apr 2017

I have tested this item successfully on 4f752db

Tested the issue:
I had 7 categories, it was making 8 querys, returning 14 rows.

After testing your PR, 7 categories, 1 query, 7 rows, and everything still works.


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

avatar laoneo laoneo - test_item - 13 Apr 2017 - Tested successfully
avatar laoneo
laoneo - comment - 13 Apr 2017

I have tested this item successfully on 4f752db


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

avatar franz-wohlkoenig franz-wohlkoenig - change - 13 Apr 2017
Status Pending Ready to Commit
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 13 Apr 2017

RTC after two successful tests.

avatar infograf768
infograf768 - comment - 13 Apr 2017

I do not see the difference.
I have 40 categories on a multingual site with 7 languages
I have 40 queries for 1 row before and after patch.

screen shot 2017-04-13 at 10 38 12

screen shot 2017-04-13 at 10 42 44

Is there something I did wrong?

avatar csthomas
csthomas - comment - 13 Apr 2017

It seems that you do not apply patch correctly or...

Take a look to the current code changes.
Maybe you tested it on the other view which is not affected by current changes.

I have removed such query from libraries/legacy/form/field/category.php.
Do you override such class somewhere?

avatar infograf768
infograf768 - comment - 13 Apr 2017

Apologies. I was a bit confused by your instructions.

Go to edit some menu item (or articles view) in backend.

I was not testing the right view.
Should have only loaded the Articles Manager where we have a Search Category Field as this does not work for the category field when editing an article (which is a pity.) :)

avatar rdeutz rdeutz - change - 15 Apr 2017
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2017-04-15 09:20:02
Closed_By rdeutz
Labels Added: ?
avatar rdeutz rdeutz - close - 15 Apr 2017
avatar rdeutz rdeutz - merge - 15 Apr 2017

Add a Comment

Login with GitHub to post a comment