#__assets with name com_content.article.X (X = id of article) created.#__assets with name #__ucm_content.X (X = id of article) created.#__content a new row with id X (article id) is created and asset_id has row value of A (e.g. id 43)#__ucm_content a new row with core_content_id X (article ID) is created and asset_id has row value of B (e.g. id 44)#__assets with name com_content.article.X (X = id of article) created.#__assets with name #__ucm_content.X (X = id of article) created.#__content a new row with id X (article id) is created and asset_id has row value of A (e.g. id 43)#__ucm_content a new row with core_content_id X (article ID) is created and asset_id has row value of A (e.g. id 43)So the new row in #__content and #__ucm_content both link to the same asset_id and the #__ucm_content.X asset has no relation in other tables. This is not correct.
This behavior is introduced with PR #39165 which sets the flag $this->_trackAssets = false; for the UCM content table. This indeed reduces useless assets rows. However this change did not take into account the fact that a new UCM content row is created when tags are added.
The incorrect asset_id store is also mentioned in the comment of the PR: #39165 (comment)
As long as data is created in the #__ucm_content the $this->_trackAssets = false; should be removed. Or the asset_id in #__ucm_content should not be set at all and the column can be removed as the asset for #__ucm_content does nothing.
| Labels |
Added:
No Code Attached Yet
|
||
| Labels |
Added:
bug
|
||
I also tested this just now in Joomla 6.0 and can't replicate it.
#__content is created with id A and asset_id B#__assets is created with id B and name com_content.article.ASo direct relation between content and asset.
All good.
#__content is created with id A and asset_id B#__assets is created with id B and name com_content.article.A#__ucm_content is created with asset_id BIn this situation we have row in #__content and #__ucm_content with the same value B for asset_id, so referring to the same asset row in #__assets. However, the asset name refers to the article, not the ucm_content.
_trackAssets (old behavior)Restore the old behavior by changing public_html/libraries/src/Table/CoreContent.php , modify $this->_trackAssets = false into $this->_trackAssets = true
#__content is created with id A and asset_id B#__assets is created with id B and name com_content.article.A#__ucm_content is created with asset_id C#__assets is created with id D and name #__ucm_content.CIn this situation we have two new assets rows, one for the content and one for the ucm_content. Each with their own direct relation between content and asset.
So since $this->_trackAssets is set to false the ucm_content rows refers to the asset_id of the article (as no "own" asset is created).
While I agree tracking assets for ucm_content only clutters the assets table, the ucm_content created should not be linked to a content asset ID. Instead the asset_id should not be set as there is no asset linked.
Ok, I understand what you mean, but I disagree with you here. In the end, the whole ucm table is supposed to be removed soon, so I wouldn't change this anymore...
The issue was not created just yet 😉 Removing ucm is very nice, for when is this scheduled?
It also won't solve it for existing sites with corrupted data at the moment.
I would have loved to have removed this in 6.0, but the decision was made against this. Now probably in 7.0.
I am struggling to replicate this in joomla 6 @sanderpotjer