remove duplicated queries#19682
remove duplicated queries#19682alikon wants to merge 8 commits intojoomla:stagingfrom alikon:patch-101
Conversation
| ->where('access IN (' . $groups . ')') | ||
| ->where($db->qn('id') . ' = ' . (int) $assocId); | ||
| ->where($db->qn('id') . ' IN (' . $catId . ')') | ||
| ->where($db->qn('published') . ' = 1') |
| $assocId = $arrId[0]; | ||
| } | ||
|
|
||
| $catId = implode(',', $assocId); |
|
What do you think about renaming |
|
from my personal pov is explained in declaration |
| { | ||
| // Include only published categories with user access | ||
| $arrId = explode(':', $langAssociation->id); | ||
| $assocId = $arrId[0]; |
There was a problem hiding this comment.
Isn’t $assocId being reassigned each time and not array as to be expected?
|
The return values are different. Before PR: After PR: |
|
I have tested this item ✅ successfully on 7d724e0 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/19682. |
Fix array's values to match previous syntax
|
@ladyjer can you please retest? |
|
Notice: Undefined variable: assocId in /Applications/MAMP/htdocs/installmulti/trunkgitnew/administrator/components/com_categories/helpers/categories.php on line 135 Warning: implode(): Invalid arguments passed in /Applications/MAMP/htdocs/installmulti/trunkgitnew/administrator/components/com_categories/helpers/categories.php on line 135 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') AND |
| $user = JFactory::getUser(); | ||
| $groups = implode(',', $user->getAuthorisedViewLevels()); | ||
|
|
||
| // No assocations |
|
Test instructions should be updated. Therefore, to test, one should not associate the menu items, only the categories concerned. Needs totally new tests. |
|
updated
👍 |
|
I have tested this item ✅ successfully on 2d30362 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/19682. |
|
@alikon Are you sure we need Before, the sql query was executed inside a loop, now it is executed outside. I have not yet tested it. |
|
I have tested this item ✅ successfully on 2d30362 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/19682. |
|
RTC This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/19682. |
|
@HLeithner please a final response 1 year old rtc pr |
|
@alikon thx for you work but this is an optimization that should go into j4 and not in j3 because it doesn't fix a bug... If this query still exists in j4 it would be great if you could rebase this pr to 4.0-dev ymmv |
Summary of Changes
the same query is executed once
Testing Instructions
Expected result
no duplicated queries
Actual result
duplicate queries one of them is this one