Update from Joomla 4.2.0 to 4.2.1
Everything ok
In articles list in backend, all categories are marked as (trashed)
Joomla 4.2.1
Linux
Php 7.4
In the article list view in backend all articles have a (trashed) mark! But non of the categories are actually trashed ???
Labels |
Removed:
?
|
Labels |
Added:
No Code Attached Yet
|
All categories are still there when I look in the categories list. Nothing changed there.
I saw this when investigating another problem, that all of a sudden a few articles could not be saved anymore. When I press save I am simply returned to the article list and nothing is saved - but do not know if this problem is related.
Hmm I cannot reproduce it here. Have updated and categories are not shown as trashed in the articles list. But I have characters in my category names. Maybe it has to do with the numeric names "2017" and "2018" (just a silly idea)?
In my applications everything in categories is published as before. Are you using template overridee in backend?
No, no overrides in backend
In my applications everything in categories is published as before. Are you using template overridee in backend?
@chmst As far as I understood the issue, the categories are not the problem. The problem is the display of the categories in the Articles list showing the categories as being trashed but they are not.
Exactly
Could this be a problem in the assets table ? This IS a site that was migrated way back from 1.5
Yes, sorry - I wanted to say that all categories in articles overviews is correct. But your idea with numbers .. maybe. We can investigate here. The asset table - no.
But just wondering, why the problem has arissen right now ?? Has there been som code changes related to the categories view or the way categories are marked as trashed ?
I also have top categories with no numbers - same problem.
Really stange. The copy of my 3.10 homepage which I once had updated to 4.0 and then later kept up to date is still fine. It has an update history not back to 1.5 but to 2.5. And it's really strange why that comes with an update from 4.2.0 to 4.2.1.
Well it might also have come from 4.1 to 4.2 - I am not quite shure there...
And the categories in question show up fine in the categories list?
go to categories
click on rebuild
Yes they do. All articles, in all categories are shown this way.
@brianteeman tried that - no change
@rubelund can you change a file in your application?
replace these lines by
if ($item->category_published < 1) :
echo $item->category_published === 0 ? ' (' . Text::_('JUNPUBLISHED') . ')' : ' (' . Text::_('JTRASHED') . ')';
endif;
maybe ...
So you mean the extra = sign - that makes no change if i add that.
Maybe better not with the strict comparison. But to change the check for < 1 is a good idea, so:
if ($item->category_published < 1) :
echo $item->category_published == 0 ? ' (' . Text::_('JUNPUBLISHED') . ')' : ' (' . Text::_('JTRASHED') . ')';
endif;
And also removing the '' around 0 and 1 - no change
Ahh - now they are all marked as Unpublished instead with @richard67's code
Could be something with the categories table. @richard67 any idea about the published column?
So possibly the $item->category_published
is not set right? What values for published
do you get when you issue following query in PhpMyAdmin (replace #__
by your database prefix?
SELECT `title`, `published` FROM `#__categories` WHERE `title` IN ('2017, '2018');
Sorry - I have to leave now - guests. I will write it later..
Seems not so critical .. but
@richard67 as the published field is a tinyint(4) in my database, the comparision with strings seems a bit strange. Maybe the column was a string in earlier joomla versions? I don't remember.
@rbuelund So 2 queries to be checked in PhpMyAdmin when you are back, wuth #__
being replaced by your database prefix:
SELECT `title`, `published` FROM `#__categories` WHERE `title` IN ('2017, '2018');
SHOW COLUMNS IN `#__categories` WHERE `field` = 'published';
Priority | Critical | ⇒ | Medium |
Any ideas on this issue ?
A template override for articles?
What du you mean ? I have no overrides in backend.
Is was just a question, as I have no explanation why your system finds a value < 0 but not == 0 here:
https://github.com/joomla/joomla-cms/blob/4.2-dev/administrator/components/com_content/tmpl/articles/default.php#L301.
Canyou add a line before this condition:
var_dump($item->category_published);
So you can see the values here - in my articles overview it is an integer 1.
I saw this when investigating another problem, that all of a sudden a few articles could not be saved anymore. When I press save I am simply returned to the article list and nothing is saved - but do not know if this problem is related.
That could be related. Did you find the reason for that?
@chmst Yes, I found the reason for the other save problem. PHP max_input_vars had to be raised on the server, because I have a lot of custom fields with galleries coupled to the articles. Would be nice though if one got a warning about that problem - quite hard to debug.
we did have a pr for that in the past but it was rejected ;(
But no one has an idea about the trashed marking on all my categories in the articles listing in backend??
I'm finding this same issue. This site was an upgrade from 3.10.11 to 4.22. All categories show (Trashed) in article list, but of course are not. Tried rebuild categories and checked the database. It doesn't affect functionality, but will confuse my client. Happy to experiment as the site is not yet live.
@alikon As found out here #38673 (comment) , the category_published values are NULL. My first idea was that the join of the categories table in the list query does not happen when there is no filtering by category, but that is not the case. The categories table should always be joined. So I have no idea why that can happen, except if the category id of the article would be wrong, but then people would see much more issues. Could you check the list query? Maybe you have an idea or see something which I am missing?
like it seems that the issue has been introduced on 4.2 then this could be the root cause #37583
@alikon That was my first thought, too, but I did not find any mistake in that code which could cause this, and the list query already joins the categories table in all cases, so the c.published
should always be in the query results. That's why I asked you, maybe I am just blind.
I identified the cause of this on aat least one site. There was a plugin from Joomlart running called System - JA Content Type. I dont know what it was for but as soon as I disabled it then everything works as expected
As soon as I enabled display of errors it was obvious - the plugin rips the guts out of core. Spits it on the floor and replaces it with a pile of poop.
https://www.joomlart.com/documentation/joomla-templates/ja-hotel-template/content-type
That was part of of the migration from K2 to articles on Joomla3 site, and must not have uninstalled with the package. Probably the culprit on the my other sites.
You really should audit what is installed on that site. there is a LOT of garbage installed that you are not using.
AND PLEASE PLEASE PLEASE when you have a problem enable error reporting and debug - it will save everyone a LOT of time
Hmm.. just checked on my site. I did not have the Joomlart plugin installed, but now all of a sudden the problem is gone ?? If it was an update that did the trick - I have no idea.
I identified the cause of this on aat least one site. There was a plugin from Joomlart running called System - JA Content Type. I dont know what it was for but as soon as I disabled it then everything works as expected
I confirm this issue and fix. Like Brian wrote.
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2022-11-30 10:19:29 |
Closed_By | ⇒ | chmst |
Thanks a lot, @brianteeman - from now on we will aks for the debugging settings, I always presumed that.
So closing this as it is not a Joomla issue.
If that joomlart plugin is listed on the JED then it should be reported and removed. It basically hacks com_content by replacing it with their modified version.
@rbuelund Do you still have these categories with names "2017" and "2018"? Or have they been trashed once and then deleted (empty trash) so they don't exist anymore?