Activate content history (https://www.ostraining.com/blog/joomla/enable-content-history/)
Create a new article and add some tags
edit the article a few times.
the article-versions are saved in the jos_ucm_* tables of the database.
create a menuitem for com_tags. Example: index.php?option=com_tags&view=tag&id[0]=3&types[0]=1&tag_list_language_filter=de-DE
The menuitem should now display all the articles that are related to this tag -> our example-article should be listed here.
Now delete the article in the joomla-backend and empty the recycle-bin.
Refresh the frontend view of the menuitem: The deleted article still shows up.
After deleting an article, the version-history should also be deleted completely. Or at least com_tags should not display articles from jos_ucm_content that was deleted in it's own database-table.
the latest saved version is display in the frontend view. If a user clicks on this article, the article-view displays an error because: The item does not exists ;-)
Joomla 3.3.6
I tried to truncate the 3 ucm tables, but that had the effect, that no article was displayed anymore. For some reason versioning-history does not work properly and should be reviewed completely to avoid these errors.
Labels |
Added:
?
|
Status | New | ⇒ | Confirmed |
Thanks @dlpix moving to confirmed
I don't think the version history should be deleted. Because people can restore the article to published state. But com_tags should definitely not show that article in the frontend
Can reproduce this with staging, I can see that ucm_content has an entry for the deleted article but nothing in the contentitem_tag_map. So I don't see the article when clicking on the menu item.
Is there already some way i can try to fix it, before the next update is available?
Ok, if anybody else needs this: I'm currently using this as a check, if a loaded item via com_tags does not exists in the content-table:
foreach ($this->items as $i => $item) {
$content_item_id = $item->content_item_id;
$article = JTable::getInstance("content");
$article->load($content_item_id); // Get Article
$article_id = $article->get("id"); // Get image parameters
if (empty($article_id)) unset($this->items[$i]);
}
This code has to be placed in the template-override /[templatename]/html/com_tags/tag/default.php just before the first DIV Tag. It removes every item from the list, that didn't load an article from com_content.
This is just a quick fix for me, use at own risk ;)
foreach ($this->items as $i => $item) {
$content_item_id = $item->content_item_id;
$article = JTable::getInstance("content");
$article->load($content_item_id); // Get Article
$article_id = $article->get("id"); // Get image parameters
if (empty($article_id)) unset($this->items[$i]);
}
wilsonge - comment - 17 Jan 15
I don't think the version history should be deleted. Because people can restore the article to published state. But com_tags should definitely not show that article in the frontend
--> But how could people restore them? There is no tool in the admin-backend for that.
go to your deleted items and instead of pressing permanent delete press publish?
@wilsonge : They are already deleted from the database. Nothing can be restored then.
Also: I need to delete items AND their content-history too, that's what this bug-report is about ;)
Did this one go into 3.4 ? I couldn't find any infos about that.
As there was no pull request to merge them no nothing has changed on this for 3.4
I couldn't able to reproduce specifically this issue but found another (a variant of this) issue. I performed following steps :
1. Created two articles Art1 & Art2 and assigned "Tag1" to both.
2. Created a menu item to show a list of articles having tag "Tag1"
3. Checked out the new menu item. It was showing Art1 & Art2
4. Deleted Art1 and empty trash
5. Checked out menu item again.
Now expected behaviour is to get only Art2 in that list.
And the description of this issue (#5708) states that the we get both Art1 & Art2.
But I get an empty list. Neither Art1 nor Art2 were there.
PS: Content history was enabled.
I had the same issue deleting categories that were tagged.
I can confirm that this code works for tagged categories:
<?php
foreach ($this->items as $i => $item) {
$content_item_id = $item->content_item_id;
$article = JTable::getInstance("content");
$article->load($content_item_id); // Get Article
$article_id = $article->get("id"); // Get image parameters
if (empty($article_id)) unset($this->items[$i]);
}
?>
Is this still an issue? I couldn't replicate it on my local.
Note: Tested on staging
This is still an issue for me. If I delete a category that was tagged, the category will still be displayed in com_tags&view=tag
The same for me.
This is still an issue. I will check for above solutions
Priority | Critical | ⇒ | Medium |
Status | Confirmed | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2017-01-13 17:15:18 |
Closed_By | ⇒ | roland-d |
Tested this on Joomla 3.6.5. and deleting an article also deletes the data in the ucm_history table.
Reproduced on 3.3.6
This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/5708.