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.
This pull request has been automatically rebased to 5.4-dev.
This pull request has been automatically rebased to 6.1-dev.
| Title |
|
||||||
| Labels |
Added:
Feature
PR-6.1-dev
|
||
This pull request has been automatically rebased to 6.2-dev.
| Title |
|
||||||
As stated in my last comment, a new Trait should be created which implements the CategoryServiceInterface with your caching changes. In version 7.0 we can then change the core classes to use that one instead the normal one, when this makes sense. Like that we will have a smooth transition and don't risk any regression as this is a central part of the core API, used by many 3rd party extensions as well. Therefor I'm closing this pr till the changes are done in a backwards compatible way.
Nevertheless, thanks for your contribution and I hope you understand the decision.
| Status | Pending | ⇒ | Closed |
| Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2026-03-17 13:58:55 |
| Closed_By | ⇒ | laoneo | |
| Labels |
Added:
PR-6.2-dev
Removed: PR-5.3-dev |
||
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.