New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug] Category state color in "Articles" tab is wrong under certain circumstances #405
Comments
The current logic to display a red category entry in the article overview is as follows:
I've checked this with differrent article states (on/offline start article/no start article) and couldn't force a wrong behaviour. Do you have more details to reproduce the issue? Addendum: The CSS class for categories marked red is set in the file contenido/includes/include.con_str_overview.php in lines 128-133. Whether the category has a start article or an online article is indicated in the same file between the lines 661-670. |
Hi Murat, I know most of the things like the refresh thing and such. The only thing I can say is that I am currently updating a multitude of Contenidos (always clean install, swaping contenido folders and such), and I do it a lot. Even with the same hosting provider and PHP 8.1 running everywhere and doing the exact same update process, in some installations, I end up with the COMPLETE wrong category colors in the articles tab. In some installations, everything is fine and I can't reproduce it there either, but in others, it is a nightmare. I have no log entries to show, no indication so far as to how and where this bug comes from. The class is set to "on_error". Only if I put ALL articles in a category online, the category is shown as online as well. If i put ANY of the articles offline, the category turns back to red. |
This is very strange behavior and the possibility that the display of the category colors may be incorrect cannot be completely ruled out. As previously written, I couldn't reproduce it for myself. The problem would have to be analyzed and isolated in more detail on a CONTENIDO installation where it occurs. |
Okay, found it. In contenido/includes/include.con_str_overview.php, two statements are missing in the if-clause starting at line 439. The WHERE-element of both SELECT statements in if/else needs one more line that was dropped from the previous versions.
Otherwise, the check in line 484 stating |
I looked in the history of the CONTENIDO versions to see when this change was made and couldn't find anything until 4.8.3. The area around the SQL statement has not been changed for over 10 years. Also, by adding The line |
We had this problem before and I am quite sure I submitted something to it around January 2021. I know for sure that I had to tweak my 4.10.1 original versions to make it work for some installations. |
I've found the related post in CONTENIDO forum, it was an issue with MySQL 8. Can you try the following for yourself, i.e. the line
change in
This may help to correctly add the values of the Can you also check whether there really are numbers in the
|
Sorry to say that your latest suggestion doesn't help. And yes, the "online" fields are set to 1 correctly in the database (which is evident anyway as my code change suggestions lead to the correct category display colors). |
As much as i understood this early morning, it could be that SUM(online) and GROUP BY(online,...) is doubeled. |
I let run both the 1st SQL once with group by online und once without group by online and got the same result.
|
OK, putting correct SQL code into the <> formatter does not work properly. |
It is a very common practice to use the I don't see a wrong syntax in the generated SQL statement, but it seems like that we have some other points to talk about. 1. The I wonder if it would work for you @tone2tone , if you remove the column 2. The value of variable But once you send the "Synchronize from" form from the action area (top left frame above article overview) by selecting the value "-- None --", then the variable @tone2tone : |
Hi Murat, |
I seem to have found one trigger that causes a difference in behaviour regarding this issue. Now that HostEurope upgraded to MySQL 8.0, websites with the original contenido code are beginning to show the "wrong" coloured icons whilst versions in MySQL5.7 didn't and would only work correct with the adapted code versions suggested above. |
Did I understand correctly that the current version of CONTENIDO works correctly under MySQL 8.0 and under MySQL 5.7 only if you remove the |
Not quite, but almost. I can confirm that it works correctly under MySQL 8.0 by removing the "online" field from the "GROUP BY" clause (and it won't work if the online-field remains there). Under 5.7 I can't tell anymore; it remember that the error strangely occured on SOME installations only. At that time, HostEurope had SOME selected hosting packages running on 8.0, but the majority still on 5.7. In retrospect, I'd say that the 5.7 versions could deal with the original source code (but the 5.7 do also work when taking the "GROUP BY online" out), whilst the 8.0 don't . |
With the latest dev-version installed, some categories are show in red color even though they have an online start article.
As far as I can see, this happens with categories that hold more than one article. It depends on the order of the articles on how the system decides as to what state the category is. If the first article in the list is online, the second offline, then the category turns red as if "offline". If the first article is offline, the second one online, then the category is marked as "online".
We had such wrong behaviour in an earlier version before.
The text was updated successfully, but these errors were encountered: