Articles disappearing and database anomalies after upgrading
Bug report
Describe the bug
Upon upgrading from version 0.4.7 to 0.4.9 (or 0.4.8), an issue arose where newly created articles, when published, caused the previous article to disappear from the table view and revert to an unpublished state. Additionally, there were anomalous changes observed in the database, with the publish date value being altered to null, and the value for is_visible_in_list_view changing from 1 to 0. However, it is noteworthy that the latest created article displayed correctly. Subsequent attempts to create new articles resulted in a recurrence of the same scenario, as evidenced by the screenshot wherein the latest article possesses the value 1 for the is_visible_in_list_view property, whereas others are assigned 0.
At first, I reported a bug in the strapi-plugin-publisher repository, assuming that the publisher plugin was responsible for the mentioned issue. However, upon further investigation, it became clear that the problem is in your plugin. Original issue can be still found here: https://github.com/ComfortablyCoding/strapi-plugin-publisher/issues/86.
Expected behavior
When I create and publish new articles, the previous persist in the table view, still are published (or in the same state as they were).
Screenshots
Code snippets
I'm attaching all of my node dependencies presented in the package.json file. I have no other strapi modifications.
{
"devDependencies": {},
"dependencies": {
"@_sh/strapi-plugin-ckeditor": "^2.0.4",
"@ef2/strapi-plugin-bold-title-editor": "1.0.8",
"@notum-cz/strapi-plugin-content-versioning": "0.4.7",
"@strapi/plugin-graphql": "4.11.7",
"@strapi/plugin-i18n": "4.11.7",
"@strapi/plugin-seo": "^1.9.2",
"@strapi/plugin-users-permissions": "4.11.7",
"@strapi/strapi": "4.11.7",
"mysql": "2.18.1",
"patch-package": "^7.0.2",
"strapi-plugin-duplicate-button": "^1.1.12",
"strapi-plugin-navigation": "^2.2.11",
"strapi-plugin-publisher": "^1.3.7",
"strapi-plugin-sitemap": "^3.0.3",
"strapi-plugin-stellate": "^0.0.5"
}
}
System
- Node.js version: v16.18.1 (also tried with v18.16.1, cause finally, after upgrading version of this plugin, build works)
- NPM version: 8.19.2
- Strapi version: 4.11.7
- Database: MariaDB 10.6.12
- Operating system: Ubuntu 22.04
Hi @DaDlugosch, changing is_visible_in_list view from 1 to 0 is a wanted behaviour as we do not want all versions of the same content to be shown in the list view. Also only one version of the content can be published at a time so altering the published_at for other non-published versions is correct.
However, the problem I see in the screenshot that you provided is that vuuid is not set and it should be. We have recently updated the uuid dependency in #102 so it might have caused some problems. I will examine it and get back to you.
Hey @DaDlugosch, I've just tested with your setup (the only difference is that I am on MacOS but that should not be a problem) and everything works fine. As I mentioned in the previous comment, the behaviour is correct and my only concern was that you have vuiid = null in your DB. That does not happen to me.
@omikulcik I was using it with the strapi-plugin-publisher plugin. Before the upgrade, when I published an article with the date in the past, it was published with that date and the date was set up in the database. After your plugin upgrade, the date was removed from the database after each publication in the past, and is_visible_in_list_view was set to 0 instead of 1, which is bug for me, because I didn't have any other versions. Only that one was intended to be published.
It seems to me that both plugins are now manipulating the same property in the DB and thus to me it is not really a bug but an incompatibility. Sorry, we unfortunately can't guarantee compatibility with other plugins.
I'm experiencing the same issue and I have not installed any other plugins.
This is the list of steps:
-
docker run -it -p 13377:1337 node:16 /bin/bash
-
npx create-strapi-app@latest my-project --quickstart
-
npm install --save @notum-cz/strapi-plugin-content-versioning
-
Update config/plugins.js
-
npm run build
-
npm run develop
-
Create new collection type with small text field, long text field and number
-
Create first entry, save and publish. I can see the entry in the list.
-
Create second entry, save and publish
-
I can see the second entry in the list but first entry is not showing any more
It works fine if the collection type does not have "Enable versioning for this Content-Type" checked.
Here is my package.json
{
"name": "my-project",
"private": true,
"version": "0.1.0",
"description": "A Strapi application",
"scripts": {
"develop": "strapi develop",
"start": "strapi start",
"build": "strapi build",
"strapi": "strapi"
},
"dependencies": {
"@notum-cz/strapi-plugin-content-versioning": "^0.4.10",
"@strapi/plugin-i18n": "4.12.1",
"@strapi/plugin-users-permissions": "4.12.1",
"@strapi/strapi": "4.12.1",
"better-sqlite3": "8.5.0"
},
"author": {
"name": "A Strapi developer"
},
"strapi": {
"uuid": "e1162a5d-59b8-4d24-82e0-172ad3ec7bf3"
},
"engines": {
"node": ">=16.0.0 <=20.x.x",
"npm": ">=6.0.0"
},
"license": "MIT"
}
Hi @lrodrigo-cluey, this is correct behaviour. In the list you should only see the latest/published version of your content. Other versions are hidden and can be seen in the dropdown in which you select a specific version.
Hey @omikulcik , the problem was that unrelated entries were hidden (not v1, and v2, just some other entry). But I realized it was my mistake, I was using Strapi "Save" button to save the first entry, and then the plug-in "Save" button to save new versions.
If anyone is having a similar issue, I solved it by applying patches:
- @notum-cz+strapi-plugin-content-versioning+0.4.10.patch (https://github.com/notum-cz/strapi-plugin-content-versioning/issues/75)
- @strapi+admin+4.12.0.patch
Same here, we have to temporarily disable this plugin. We just upgraded to the latest version, and boom, all the new articles disappeared.
@Novaera Have you applied the patch?
Hi guys, we have just published a new version that removes the need to patch strapi admin and works and uses entity service decorator. Can you please test whether this problem still persists in this newer version?