User tests: Successful: Unsuccessful:
Subsequent calls to $componentObject->getCategory()
produce the same SQL query.
Add custom fields for articles, limit fields to category "Any Category".
Add fields values for articles from this category.
Show articles from this category in frontend, i.e. via Category Blog and show custom field values.
See multiple SQL query duplicates with the same params like:
SELECT `c`.`id`,`c`.`asset_id`,`c`.`access`,`c`.`alias`,`c`.`checked_out`,`c`.`checked_out_time`,`c`.`created_time`,`c`.`created_user_id`,`c`.`description`,`c`.`extension`,`c`.`hits`,`c`.`language`,`c`.`level`,`c`.`lft`,`c`.`metadata`,`c`.`metadesc`,`c`.`metakey`,`c`.`modified_time`,`c`.`note`,`c`.`params`,`c`.`parent_id`,`c`.`path`,`c`.`published`,`c`.`rgt`,`c`.`title`,`c`.`modified_user_id`,`c`.`version`, CASE WHEN CHAR_LENGTH(`c`.`alias`) != 0 THEN CONCAT_WS(':', `c`.`id`, `c`.`alias`) ELSE `c`.`id` END as `slug`
FROM `jos_categories` AS `s`
INNER JOIN `jos_categories` AS `c` ON (`s`.`lft` < `c`.`lft` AND `c`.`lft` < `s`.`rgt` AND `c`.`language` IN (:preparedArray3,:preparedArray4)) OR (`c`.`lft` <= `s`.`lft` AND `s`.`rgt` <= `c`.`rgt`)
WHERE (`c`.`extension` = :extension OR `c`.`extension` = 'system') AND `c`.`access` IN (:preparedArray1,:preparedArray2) AND `c`.`published` = 1 AND `s`.`id` = :id
ORDER BY `c`.`lft`
Only single query with the same params.
Please select:
Status | New | ⇒ | Pending |
Category | ⇒ | Libraries |
Labels |
Added:
PR-5.3-dev
|
Instead of modifying the existing one, I would create a new one. Like that you don't risk bc breaks.
Not sure about this. With the patch applied I see the number of queries decrease by 1 but the query quoted above is still duplicated. Without the patch there are 3 instances, with the patch there are two instancies.