?
avatar Robdebert
Robdebert
13 Jan 2015

Steps to reproduce the issue

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.

Expected result

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.

Actual result

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 ;-)

System information (as much as possible)

Joomla 3.3.6

Additional comments

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.

Votes

# of Users Experiencing Issue
4/5
Average Importance Score
4.20

avatar Robdebert Robdebert - open - 13 Jan 2015
avatar brianteeman brianteeman - change - 14 Jan 2015
Labels Added: ?
avatar dlpix
dlpix - comment - 16 Jan 2015

Reproduced on 3.3.6


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/5708.
avatar zero-24 zero-24 - change - 16 Jan 2015
Status New Confirmed
avatar zero-24
zero-24 - comment - 16 Jan 2015

Thanks @dlpix moving to confirmed


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/5708.
avatar wilsonge
wilsonge - comment - 17 Jan 2015

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


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/5708.
avatar rdeutz
rdeutz - comment - 18 Jan 2015

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.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/5708.
avatar Robdebert
Robdebert - comment - 22 Jan 2015

Is there already some way i can try to fix it, before the next update is available?


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/5708.
avatar Robdebert
Robdebert - comment - 23 Jan 2015

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 ;)


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/5708.
avatar Robdebert
Robdebert - comment - 23 Jan 2015

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 comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/5708.
avatar Robdebert
Robdebert - comment - 23 Jan 2015

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.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/5708.
avatar wilsonge
wilsonge - comment - 24 Jan 2015

go to your deleted items and instead of pressing permanent delete press publish?

avatar Robdebert
Robdebert - comment - 26 Jan 2015

@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 ;)


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/5708.
avatar Robdebert
Robdebert - comment - 26 Feb 2015

Did this one go into 3.4 ? I couldn't find any infos about that.

avatar brianteeman
brianteeman - comment - 26 Feb 2015

As there was no pull request to merge them no nothing has changed on this for 3.4


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/5708.
avatar Achal-Aggarwal
Achal-Aggarwal - comment - 17 Apr 2015

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.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/5708.

avatar modernmagic
modernmagic - comment - 30 Jun 2015

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]);
}
?>


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/5708.

avatar Achal-Aggarwal
Achal-Aggarwal - comment - 25 Jul 2015

Is this still an issue? I couldn't replicate it on my local.
Note: Tested on staging

avatar modernmagic
modernmagic - comment - 25 Nov 2015

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

avatar skouf
skouf - comment - 4 Dec 2015

The same for me.

This is still an issue. I will check for above solutions

avatar sandrodz
sandrodz - comment - 22 Dec 2015

#8770 related?

avatar Kubik-Rubik Kubik-Rubik - change - 8 May 2016
Priority Critical Medium
avatar roland-d roland-d - change - 13 Jan 2017
Status Confirmed Closed
Closed_Date 0000-00-00 00:00:00 2017-01-13 17:15:18
Closed_By roland-d
avatar roland-d
roland-d - comment - 13 Jan 2017

Tested this on Joomla 3.6.5. and deleting an article also deletes the data in the ucm_history table.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/5708.

avatar roland-d roland-d - change - 13 Jan 2017
The description was changed
avatar roland-d roland-d - edited - 13 Jan 2017
avatar roland-d roland-d - close - 13 Jan 2017

Add a Comment

Login with GitHub to post a comment