No Code Attached Yet
avatar rbuelund
rbuelund
2 Sep 2022

Steps to reproduce the issue

Update from Joomla 4.2.0 to 4.2.1

Expected result

Everything ok

Actual result

In articles list in backendscreen shot 2022-09-02 at 17 03 20, all categories are marked as (trashed)

System information (as much as possible)

Joomla 4.2.1
Linux
Php 7.4

Additional comments

In the article list view in backend all articles have a (trashed) mark! But non of the categories are actually trashed ???
screen shot 2022-09-02 at 17 03 20

avatar rbuelund rbuelund - open - 2 Sep 2022
avatar rbuelund rbuelund - change - 2 Sep 2022
Labels Removed: ?
avatar joomla-cms-bot joomla-cms-bot - change - 2 Sep 2022
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 2 Sep 2022
avatar richard67
richard67 - comment - 2 Sep 2022

@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?

avatar rbuelund
rbuelund - comment - 2 Sep 2022

All categories are still there when I look in the categories list. Nothing changed there.

avatar rbuelund
rbuelund - comment - 2 Sep 2022

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.

avatar richard67
richard67 - comment - 2 Sep 2022

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

avatar chmst
chmst - comment - 2 Sep 2022

In my applications everything in categories is published as before. Are you using template overridee in backend?

avatar rbuelund
rbuelund - comment - 2 Sep 2022

No, no overrides in backend

avatar richard67
richard67 - comment - 2 Sep 2022

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.

avatar rbuelund
rbuelund - comment - 2 Sep 2022

Exactly

avatar rbuelund
rbuelund - comment - 2 Sep 2022

Could this be a problem in the assets table ? This IS a site that was migrated way back from 1.5

avatar chmst
chmst - comment - 2 Sep 2022

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.

avatar rbuelund
rbuelund - comment - 2 Sep 2022

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 ?

avatar rbuelund
rbuelund - comment - 2 Sep 2022

I also have top categories with no numbers - same problem.

avatar rbuelund
rbuelund - comment - 2 Sep 2022

As you can see here
categories trashed

avatar richard67
richard67 - comment - 2 Sep 2022

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.

avatar rbuelund
rbuelund - comment - 2 Sep 2022

Well it might also have come from 4.1 to 4.2 - I am not quite shure there...

avatar richard67
richard67 - comment - 2 Sep 2022

And the categories in question show up fine in the categories list?

avatar brianteeman
brianteeman - comment - 2 Sep 2022

go to categories
click on rebuild

avatar rbuelund
rbuelund - comment - 2 Sep 2022

Yes they do. All articles, in all categories are shown this way.

avatar rbuelund
rbuelund - comment - 2 Sep 2022

@brianteeman tried that - no change

avatar chmst
chmst - comment - 2 Sep 2022

@rubelund can you change a file in your application?

If yes:
https://github.com/joomla/joomla-cms/blob/4.2-dev/administrator/components/com_content/tmpl/articles/default.php#L301

replace these lines by

                                            if ($item->category_published < 1) :
                                                echo $item->category_published === 0 ? ' (' . Text::_('JUNPUBLISHED') . ')' : ' (' . Text::_('JTRASHED') . ')';
                                            endif;

maybe ...

avatar rbuelund
rbuelund - comment - 2 Sep 2022

So you mean the extra = sign - that makes no change if i add that.

avatar richard67
richard67 - comment - 2 Sep 2022

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;
avatar rbuelund
rbuelund - comment - 2 Sep 2022

And also removing the '' around 0 and 1 - no change

avatar rbuelund
rbuelund - comment - 2 Sep 2022

Ahh - now they are all marked as Unpublished instead with @richard67's code

avatar chmst
chmst - comment - 2 Sep 2022

Could be something with the categories table. @richard67 any idea about the published column?

avatar richard67
richard67 - comment - 2 Sep 2022

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');
avatar rbuelund
rbuelund - comment - 2 Sep 2022

Sorry - I have to leave now - guests. I will write it later..

avatar chmst
chmst - comment - 2 Sep 2022

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.

avatar richard67
richard67 - comment - 2 Sep 2022

@chmst Depending on the database driver (MySQLi or MySQL PDO) and the kind of database (MySQL and MariaDB) and their versions, some drivers return a string and some an integer.

avatar richard67
richard67 - comment - 2 Sep 2022

@rbuelund So 2 queries to be checked in PhpMyAdmin when you are back, wuth #__ being replaced by your database prefix:

  1. As mentioned above:
SELECT `title`, `published` FROM `#__categories` WHERE `title` IN ('2017, '2018');
  1. Data type of the category table's published column:
SHOW COLUMNS IN `#__categories` WHERE `field` = 'published';
avatar rbuelund
rbuelund - comment - 3 Sep 2022

Ok - now I have run the two sql queries.
The first one returns nothing.
The second returns:
result

Edit: WRONG prefix - sorry. See further down

avatar richard67
richard67 - comment - 3 Sep 2022

@rbuelund Why does the first query return nothing? The titles in the where clause were the same as shown in your screenshots. Anyway, leave the where clause away and check the values of the published column.

avatar rbuelund
rbuelund - comment - 3 Sep 2022

Terribly sorry - it was the wrong prefix of course !!
Result of query 1:
1 query
Result of query 2:
2 query

avatar chmst chmst - change - 4 Sep 2022
Priority Critical Medium
avatar rbuelund
rbuelund - comment - 6 Sep 2022

Any ideas on this issue ?


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

avatar chmst
chmst - comment - 7 Sep 2022

A template override for articles?

avatar rbuelund
rbuelund - comment - 7 Sep 2022

What du you mean ? I have no overrides in backend.

avatar chmst
chmst - comment - 7 Sep 2022

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

grafik

So you can see the values here - in my articles overview it is an integer 1.
grafik

avatar rbuelund
rbuelund - comment - 7 Sep 2022

If I add var_dump($item->category_published); in line 301 I get this output:
dump

avatar chmst
chmst - comment - 7 Sep 2022

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?

avatar rbuelund
rbuelund - comment - 8 Sep 2022

@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.

avatar brianteeman
brianteeman - comment - 8 Sep 2022

we did have a pr for that in the past but it was rejected ;(

avatar rbuelund
rbuelund - comment - 8 Sep 2022

But no one has an idea about the trashed marking on all my categories in the articles listing in backend??

avatar richard67
richard67 - comment - 8 Sep 2022

But no one has an idea about the trashed marking on all my categories in the articles listing in backend??

@rbuelund Not yet. Maybe tomorrow or on weekend.

avatar tmumm
tmumm - comment - 26 Sep 2022

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.

Content_Manager__Items_-The_Children_s_Center_Utah-_Administration

avatar mrownicki
mrownicki - comment - 6 Oct 2022

Please merge
#38913
Problem is affect upgrade 3.10.11 to 4.2.0 - 4.2.3
View from 4.1.5 work ;)

avatar richard67
richard67 - comment - 7 Oct 2022

@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?

avatar alikon
alikon - comment - 7 Oct 2022

like it seems that the issue has been introduced on 4.2 then this could be the root cause #37583

avatar richard67
richard67 - comment - 7 Oct 2022

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.

avatar chmst
chmst - comment - 9 Oct 2022

See this comment (#38673 (comment)).

How can $item->category_published be NULL after upgrading?

avatar richard67
richard67 - comment - 9 Oct 2022

@chmst It can be null not in the categories table but in the list query when the JOIN fails, i.e. doesn't find the right category records.

avatar brianteeman
brianteeman - comment - 29 Nov 2022

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

avatar brianteeman
brianteeman - comment - 29 Nov 2022

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

avatar tmumm
tmumm - comment - 29 Nov 2022

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.

avatar brianteeman
brianteeman - comment - 29 Nov 2022

You really should audit what is installed on that site. there is a LOT of garbage installed that you are not using.

avatar brianteeman
brianteeman - comment - 29 Nov 2022

AND PLEASE PLEASE PLEASE when you have a problem enable error reporting and debug - it will save everyone a LOT of time

avatar rbuelund
rbuelund - comment - 30 Nov 2022

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.

avatar mrownicki
mrownicki - comment - 30 Nov 2022

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.

avatar chmst chmst - change - 30 Nov 2022
Status New Closed
Closed_Date 0000-00-00 00:00:00 2022-11-30 10:19:29
Closed_By chmst
avatar chmst chmst - close - 30 Nov 2022
avatar chmst
chmst - comment - 30 Nov 2022

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.

avatar brianteeman
brianteeman - comment - 30 Nov 2022

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.

Add a Comment

Login with GitHub to post a comment