The content is restored and the article should be assigned to CAT2, the category showed in the Category field after the restore.
The content is correctly restored, but looking at the list of articles I can see that the article has un undefined category, like this:
Article title
Alias: article
Category: » » (Trashed)
In the #__content table, the catid field has the id of CAT1, the removed category.
Viewing the article from frontend I get a 404 error, I guess because the article is assigned to a nonexistent category.
To resolve, I have to edit the article from the backend: the category field in the form shows automatically CAT2 (the first category available). Saving the article solves the problem, reassigning it to an existing category.
PHP 8, Joomla 5.3.1
From the frontend, reproducing the above steps, cause an additional problem because after restoring, the 404 error prevents me to access the edit form.
Labels |
Added:
No Code Attached Yet
|
Labels |
Added:
bug
|
In Joomla, when an article’s category is deleted or trashed, trying to view that article shows a 404 error — even if the article itself exists and is published.
This happens because Joomla checks for the existence of the category while displaying the article, since categories are used for routing, layout, and access control.
But from a user’s point of view, this can be confusing. The article is valid, but it doesn't show just because its category is gone.
A better approach would be to still display the article. A single article should not be strictly dependent on its category. If we are displaying articles through a category view, then yes — it makes sense to check if the category exists. But for direct single article views, Joomla should skip the category check and allow the article to display normally.
No it should not.
Hi @brianteeman ,
I’d really appreciate your thoughts on the above solutions. I'm happy to contribute further or help implement any part of this if it's considered worth improving. Looking forward to your review and feedback.
What you are suggesting is completely wrong. If a category is unpublished or trashed then any content in that category should not be visible. If you cahnge that behaviour then you break existing sites
When restoring an article version that was originally assigned to a now-deleted or trashed category, Joomla should:
Display the Restored Category as "Trashed"
In the article edit form, show the exact category from the restored version, even if it's trashed or deleted.
Display it in the dropdown as:
Category: CAT1 (Trashed)
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/45616.