notum-cz / strapi-plugin-content-versioning Goto Github PK
View Code? Open in Web Editor NEWThis plugin enables content versioning in Strapi
This plugin enables content versioning in Strapi
The latest patch file in the repository @strapi+admin+4.5.0.patch
fails with an error when running patch-package
on Strapi 4.5.4.
patches/
.patch-package
.Patch is applied without any errors or warnings.
$ patch-package
patch-package 6.5.0
Applying patches...
**ERROR** Failed to apply patch for package @strapi/admin at path
node_modules/@strapi/admin
This error was caused because patch-package cannot apply the following patch file:
patches/@strapi+admin+4.5.4.patch
Try removing node_modules and trying again. If that doesn't work, maybe there was
an accidental change made to the patch file? Try recreating it by manually
editing the appropriate files and running:
patch-package @strapi/admin
If that doesn't work, then it's a bug in patch-package, so please submit a bug
report. Thanks!
https://github.com/ds300/patch-package/issues
---
patch-package finished with 1 error(s).
Downgrading to Strapi 4.5.3 allows to run the patch without any errors.
Create new version of patch for newer version of strapi. Current patch is outdated.
When running npm install
on a project with this plugin and strapi v4.3.0+, I receive the following Error:
ModuleNotFoundError: Module not found: Error: Can't resolve 'moment' in '/opt/node_modules/@notum-cz/strapi-plugin-content-versioning/admin/src/components/Versions'
npm i
Strapi app should install successfully.
It seems like strapi removed their 'moment' dependency as of PR #13728.
I just installed this plugin in 4.1.9. However, the patch is for 4.0.2. Here's an updated version of the patch.
This is patch for Strapi 4.9.0. Feel free to use
diff --git a/node_modules/@strapi/admin/admin/src/content-manager/components/CollectionTypeFormWrapper/index.js b/node_modules/@strapi/admin/admin/src/content-manager/components/CollectionTypeFormWrapper/index.js
--- a/node_modules/@strapi/admin/admin/src/content-manager/components/CollectionTypeFormWrapper/index.js
+++ b/node_modules/@strapi/admin/admin/src/content-manager/components/CollectionTypeFormWrapper/index.js
@@ -247,9 +247,15 @@
replace(redirectionLink);
}, [redirectionLink, replace]);
+ const currentContentTypeLayout = get(allLayoutData, ['contentType'], {});
+
+ const hasVersions = useMemo(() => {
+ return get(currentContentTypeLayout, ['pluginOptions', 'versions', 'versioned'], false);
+ }, [currentContentTypeLayout]);
+
const onPost = useCallback(
async (body, trackerProperty) => {
- const endPoint = `${getRequestUrl(`collection-types/${slug}`)}${rawQuery}`;
+ const endPoint = hasVersions ? `/content-versioning/${slug}/save` : `${getRequestUrl(`collection-types/${slug}`)}${rawQuery}`;
try {
// Show a loading button in the EditView/Header.js && lock the app => no navigation
@@ -269,7 +275,13 @@
// Enable navigation and remove loaders
dispatch(setStatus('resolved'));
- replace(`/content-manager/collectionType/${slug}/${data.id}${rawQuery}`);
+ if (hasVersions) {
+ replace({
+ pathname: `/content-manager/collectionType/${slug}/${data.id}`,
+ });
+ } else {
+ replace(`/content-manager/collectionType/${slug}/${data.id}${rawQuery}`);
+ }
return Promise.resolve(data);
} catch (err) {
@@ -322,14 +334,14 @@
const onPut = useCallback(
async (body, trackerProperty) => {
- const endPoint = getRequestUrl(`collection-types/${slug}/${id}`);
+ const endPoint = hasVersions ? `/content-versioning/${slug}/save` : getRequestUrl(`collection-types/${slug}/${id}`);
try {
trackUsageRef.current('willEditEntry', trackerProperty);
dispatch(setStatus('submit-pending'));
- const { data } = await axiosInstance.put(endPoint, body);
+ const { data } = hasVersions ? await axiosInstance.post(endPoint, body) : await axiosInstance.put(endPoint, body);
trackUsageRef.current('didEditEntry', { trackerProperty });
toggleNotification({
@@ -341,6 +353,12 @@
dispatch(setStatus('resolved'));
+ if (hasVersions) {
+ replace({
+ pathname: `/content-manager/collectionType/${slug}/${data.id}`,
+ });
+ }
+
return Promise.resolve(data);
} catch (err) {
trackUsageRef.current('didNotEditEntry', { error: err, trackerProperty });
diff --git a/node_modules/@strapi/admin/admin/src/content-manager/components/EditViewDataManagerProvider/index.js b/node_modules/@strapi/admin/admin/src/content-manager/components/EditViewDataManagerProvider/index.js
--- a/node_modules/@strapi/admin/admin/src/content-manager/components/EditViewDataManagerProvider/index.js
+++ b/node_modules/@strapi/admin/admin/src/content-manager/components/EditViewDataManagerProvider/index.js
@@ -56,6 +56,10 @@
return get(currentContentTypeLayout, ['options', 'draftAndPublish'], false);
}, [currentContentTypeLayout]);
+ const hasVersions = useMemo(() => {
+ return get(currentContentTypeLayout, ['pluginOptions', 'versions', 'versioned'], false);
+ }, [currentContentTypeLayout]);
+
const shouldNotRunValidations = useMemo(() => {
return hasDraftAndPublish && !initialData.publishedAt;
}, [hasDraftAndPublish, initialData.publishedAt]);
@@ -515,7 +519,7 @@
) : (
<>
<Prompt
- when={!isEqual(modifiedData, initialData)}
+ when={!hasVersions && !isEqual(modifiedData, initialData)}
message={formatMessage({ id: 'global.prompt.unsaved' })}
/>
<form noValidate onSubmit={handleSubmit}>
This plugin does not work when updating to strapi v4.6.2
After updating to strapi v4.6.2 publishing content doesn't work. When I click 'Publish' it saves a new blank version of the content and the original content is still in draft.
This might be due to the fact that axiosInstance
has now been deprecated..?
The original content is published
The plugin does not work well with internationalized content.
I should be able to see the entry I created. Also noticed one bug if I create a new entry and add a translation for it, then the publish button will unpublish the English version (initial translation)
Fill in from another locale is also not working correctly. I'm guessing the internationalization part does not play well with the versioning schema.
Hey guys, really love your package. Still a bit of a ways to got but getting there. I was trying to implement my own redirects, as currently, the shown version displays the Published page, I was trying to set it so when a versioned type is clicked in Content Manager. it would display the most recent version by forcing a redirect, which is how most of our CMS's work.
Is there any way you could recommend how I approach this?
So, I made some middleware that does almost exactly what I want. Only problem is when you redirect within selecting a react link it doesn't do a proper redirect. It will just replace the content of what is in the text fields, which works.... until you select publish. here's the middleware code.
module.exports = (config, {strapi}) => {
return async (ctx, next) => {
if (ctx.url.includes('/content-manager/single-types')) {
const dataVersions = ctx.response.body.versions;
if (dataVersions && dataVersions.length > 1) {
let newestVersion;
dataVersions.forEach(version => {
if (!newestVersion || newestVersion.versionNumber < version.versionNumber) {
newestVersion = version;
}
});
ctx.redirect('/admin/content-manager/collectionType/api::about-content.about-content/' + newestVersion.id);
}
}
}
};
Any other suggestions or recommendations are welcome
line 4 in README.md
Heaving multiple draft versionswhite_check_mark
should be => Having
Content-versioning behave abnormal with Strapi v4.3.2
Step 1: - Create a Content and save.
Step 2: - Modify some changes in content and save as new version
.
Step 3: - You will get a an alert prompt that you will lost your changes.
Step 4: - Reload the page and then you will get your new version content in the dropdown.
Rather than It should prompt a green message that you have successfully made your changes. Previously it was working with strapi v4.0.3
Plugin Configuration
"content-versioning": {
enabled: true,
},
I would like to have versioning on uploaded files. I hope to get an idea if using/extending this plugin would be a reasonable approach.
The upload plugin adds a file content-type. I would like this plugin to version it in a way similar to normal content-types. However, there is more to this plugin than just incrementing a version:
I did not dig into the draft/publish workflow yet, but the file content-type does not provide draft/publish state. Also, there are no injection zones in the media-library component to add a version selector or "save as new version" button. I start to think if extending this plugin to enable file versioning is as straight forward I thought of in the beginning.
Do you have had any plans already to version uploaded files? If so, I am pretty sure, you will have a more comprehensive idea what would be needed and what is required to do to make this work.
Any thoughts/guides/alternatives on that?
Hi,
Please help us,
As as strapi admin i want to create multiple version of the content using strapi content versioning.When i save a content as new version the API is directly called and throws if there any error in prompt Message component.But the native save button will validates and shows the error in the input fields instantly.
Steps to reproduce the behavior
1.Open content Manager
2.Select any collection type and click editany content.
3.click save a a new version "Button".
4.You will receive Error prompt message instant of showing the message in the input field.
5.If you click regular save button the validation message is shown in the input field itself.
Expected behavior
Current behavior
System
Hi @martincapek ! You seem to have forgotten to release the latest merge into master. We've tried to address this in the PR itself, but we don't get any response...
I'm using next.js on the frontend of my service, and for my On-demand Incremental Static Regeneration I'm using Strapi's webhooks so I can rebuild certain paths on-demand whenever their Strapi instance changes.
When I save and publish a content entry it usually triggers the event "update" with the updated object, and right after it, the event "publish" with the updated object again. So far so good, these triggers are what I would expect from this kind of action.
However, when I've just saved a new version of the entry and hit "publish", I get both events (update & publish), but the object which is attached to the publish-event has isVisibleInListView: false
and publishedAt: null
.
The update-event's object is triggered with a published version, but since it is triggered before the publish-event; it is overwritten and the newly published version is instantly removed from my build.
Do you have any idea why this happens? Why is the publish-event's object not published?
body.entry
doesn't reflect the publish state of the actual Strapi entry.I would expect the publish-trigger to include a published entry, not an unpublished one.
Making changes to content and clicking "save as new version" without saving beforehand will cause the plugin to falsely create a new version when user clicks cancel on the confirmation dialog.
We are trying to implement a preview button for the latest version. We's love to be able to access the data of the versions from the api. For example,
localhost:1337/articles?versions=all
And this would return all of the versions? Does something like this exist?
The latest patch file in the repository @strapi+admin+4.5.4.patch
fails with an error when running patch-package
on Strapi 4.6.0.
patches/
.patch-package
.Patch is applied without any errors or warnings.
$ patch-package
patch-package 6.5.0
Applying patches...
**ERROR** Failed to apply patch for package @strapi/admin at path
node_modules/@strapi/admin
This error was caused because patch-package cannot apply the following patch file:
patches/@strapi+admin+4.5.4.patch
Try removing node_modules and trying again. If that doesn't work, maybe there was
an accidental change made to the patch file? Try recreating it by manually
editing the appropriate files and running:
patch-package @strapi/admin
If that doesn't work, then it's a bug in patch-package, so please submit a bug
report. Thanks!
https://github.com/ds300/patch-package/issues
---
patch-package finished with 1 error(s).
Downgrading to Strapi 4.5.6 allows to run the patch without any errors.
Hi,
I have a problem on Ckeditor content while switching version.
I created a content type with a text field and a ckeditor field. When I switch version using the selector "Change to version", the new version page is loaded, the text field is ok, but the ckeditor field keeps the old version content. I have to manually reload the page to find back the content of the current version in the ckeditor field.
I have not the problem on localhost but on the strapi production server.
Do yo guys have any idea ?
thanks
Hey, can you please update the patches for the latest strapi version 4.4.7?
Thanks
When a collection (A) has a relation to versioned collection (B) the dropdown in the edit view lists all the entries of collection (B) instead of just the latest ones. In other words: the relation-dropdown doesn't respect the "is_visible_in_list_view"-flag.
Only the latest versions of every entry of collection (B) should appear in the dropdown.
Hello,
I am trying to create a new version of a resource through the API without success.
I tried to PUT
the same resource incrementing the versionNumber
and passing the same vuid
but the exact same resource got updated.
I also tried to POST
the same resource content, still passing versionNumber
and the same vuid
but using the endpoint /:slug/:resourceId
(the resourceId is the strapi integer id) as I see from the source code but I got 405 Method Not Allowed
.
Where Am I doing wrong?
On the permission level, the token that I use got the full permission to play that slug
property.
A recent fix for making this plugin compatible with localization #47 provided by @Fikoun includes multiple instances of SELECT DISTINCT ON
, which is a Postgres-specific query that does NOT work with other databases like MySQL.
Our project is using MySQL, so these queries are considered syntactically invalid and cause fatal errors whenever they are triggered (e.g. when updating an entry).
Although the queries would become more verbose, it would be ideal to replace them with non-db-specific ones (and also avoid introducing db-specific queries in the future) so that devs are not limited to using a specific db like Postgres for their Strapi project if they want to use this plugin.
error: SELECT DISTINCT ON (locale) id, version_number, published_at, locale FROM tests WHERE vuid='88b6e1e7-c360-4a24-b1e3-5460493b1c3c' ORDER BY locale, published_at DESC NULLS LAST, version_number DESC - near "ON": syntax error
The updated entry is successfully saved, whether in the current version or in a new version.
Instances of SELECT DISTINCT ON
added in #47: 1 2 3
When trying to create any content type, we are getting a 500 error and when digging into it locally the error we are getting looks like this
error: uuid is not a function
TypeError: uuid is not a function
at Object.beforeCreate (/Users/jordanschinella/Sites/connectedfitness/connectedfitness-v2/node_modules/@notum-cz/strapi-plugin-content-versioning/server/services/lifecycles/beforeCreate.js:9:30)
at Object.beforeCreate (/Users/jordanschinella/Sites/connectedfitness/connectedfitness-v2/node_modules/@notum-cz/strapi-plugin-content-versioning/server/bootstrap.js:54:34)
at Object.run (/Users/jordanschinella/Sites/connectedfitness/connectedfitness-v2/node_modules/@strapi/database/lib/lifecycles/index.js:57:35)
at processTicksAndRejections (internal/process/task_queues.js:95:5)
at async Object.create (/Users/jordanschinella/Sites/connectedfitness/connectedfitness-v2/node_modules/@strapi/database/lib/entity-manager.js:158:7)
at async Object.create (/Users/jordanschinella/Sites/connectedfitness/connectedfitness-v2/node_modules/@strapi/strapi/lib/services/entity-service/index.js:172:18)
at async Object.<anonymous> (/Users/jordanschinella/Sites/connectedfitness/connectedfitness-v2/node_modules/@strapi/strapi/lib/services/entity-service/index.js:67:20)
at async Object.create (/Users/jordanschinella/Sites/connectedfitness/connectedfitness-v2/node_modules/@strapi/plugin-i18n/server/services/entity-service-decorator.js:117:19)
at async Object.create (/Users/jordanschinella/Sites/connectedfitness/connectedfitness-v2/node_modules/@strapi/plugin-content-manager/server/controllers/collection-types.js:85:20)
at async returnBodyMiddleware (/Users/jordanschinella/Sites/connectedfitness/connectedfitness-v2/node_modules/@strapi/strapi/lib/services/server/compose-endpoint.js:52:18)
at async module.exports (/Users/jordanschinella/Sites/connectedfitness/connectedfitness-v2/node_modules/@strapi/plugin-content-manager/server/middlewares/routing.js:39:3)
at async policiesMiddleware (/Users/jordanschinella/Sites/connectedfitness/connectedfitness-v2/node_modules/@strapi/strapi/lib/services/server/policy.js:24:5)
at async /Users/jordanschinella/Sites/connectedfitness/connectedfitness-v2/node_modules/@strapi/strapi/lib/middlewares/body.js:25:7
at async /Users/jordanschinella/Sites/connectedfitness/connectedfitness-v2/node_modules/@strapi/strapi/lib/middlewares/logger.js:22:5
at async /Users/jordanschinella/Sites/connectedfitness/connectedfitness-v2/node_modules/@strapi/strapi/lib/middlewares/powered-by.js:16:5
On the latest version of the plugin, try to create any content item.
Content saves as expected.
If applicable, add screenshots to help explain your problem.
If applicable, add code samples to help explain your problem.
removing plugin and creating content works as expected
Build fails with publisher plugin enabled on latest strapi version 4.1.5
npm run build --clean
build fails with this error
ModuleNotFoundError: Module not found: Error: Can't resolve '@strapi/design-system/Text' in '/Users/jordanschinella/Sites/connectedfitness/connectedfitness-v2/node_modules/@notum-cz/strapi-plugin-content-versioning/admin/src/components/Versions' at /Users/jordanschinella/Sites/connectedfitness/connectedfitness-v2/node_modules/webpack/lib/Compilation.js:2011:28 at /Users/jordanschinella/Sites/connectedfitness/connectedfitness-v2/node_modules/webpack/lib/NormalModuleFactory.js:795:13 at eval (eval at create (/Users/jordanschinella/Sites/connectedfitness/connectedfitness-v2/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:10:1) at /Users/jordanschinella/Sites/connectedfitness/connectedfitness-v2/node_modules/webpack/lib/NormalModuleFactory.js:275:22 at eval (eval at create (/Users/jordanschinella/Sites/connectedfitness/connectedfitness-v2/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:9:1) at /Users/jordanschinella/Sites/connectedfitness/connectedfitness-v2/node_modules/webpack/lib/NormalModuleFactory.js:431:22 at /Users/jordanschinella/Sites/connectedfitness/connectedfitness-v2/node_modules/webpack/lib/NormalModuleFactory.js:124:11 at /Users/jordanschinella/Sites/connectedfitness/connectedfitness-v2/node_modules/webpack/lib/NormalModuleFactory.js:667:25 at /Users/jordanschinella/Sites/connectedfitness/connectedfitness-v2/node_modules/webpack/lib/NormalModuleFactory.js:852:8 at /Users/jordanschinella/Sites/connectedfitness/connectedfitness-v2/node_modules/webpack/lib/NormalModuleFactory.js:972:5 at /Users/jordanschinella/Sites/connectedfitness/connectedfitness-v2/node_modules/neo-async/async.js:6883:13 at /Users/jordanschinella/Sites/connectedfitness/connectedfitness-v2/node_modules/webpack/lib/NormalModuleFactory.js:955:45 at finishWithoutResolve (/Users/jordanschinella/Sites/connectedfitness/connectedfitness-v2/node_modules/enhanced-resolve/lib/Resolver.js:312:11) at /Users/jordanschinella/Sites/connectedfitness/connectedfitness-v2/node_modules/enhanced-resolve/lib/Resolver.js:386:15 at /Users/jordanschinella/Sites/connectedfitness/connectedfitness-v2/node_modules/enhanced-resolve/lib/Resolver.js:435:5 at eval (eval at create (/Users/jordanschinella/Sites/connectedfitness/connectedfitness-v2/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:15:1) resolve '@strapi/design-system/Text' in '/Users/jordanschinella/Sites/connectedfitness/connectedfitness-v2/node_modules/@notum-cz/strapi-plugin-content-versioning/admin/src/components/Versions' Parsed request is a module using description file: /Users/jordanschinella/Sites/connectedfitness/connectedfitness-v2/node_modules/@notum-cz/strapi-plugin-content-versioning/package.json (relative path: ./admin/src/components/Versions) Field 'browser' doesn't contain a valid alias configuration resolve as module /Users/jordanschinella/Sites/connectedfitness/connectedfitness-v2/node_modules/@notum-cz/strapi-plugin-content-versioning/admin/src/components/Versions/node_modules doesn't exist or is not a directory /Users/jordanschinella/Sites/connectedfitness/connectedfitness-v2/node_modules/@notum-cz/strapi-plugin-content-versioning/admin/src/components/node_modules doesn't exist or is not a directory /Users/jordanschinella/Sites/connectedfitness/connectedfitness-v2/node_modules/@notum-cz/strapi-plugin-content-versioning/admin/src/node_modules doesn't exist or is not a directory /Users/jordanschinella/Sites/connectedfitness/connectedfitness-v2/node_modules/@notum-cz/strapi-plugin-content-versioning/admin/node_modules doesn't exist or is not a directory looking for modules in /Users/jordanschinella/Sites/connectedfitness/connectedfitness-v2/node_modules/@notum-cz/strapi-plugin-content-versioning/node_modules /Users/jordanschinella/Sites/connectedfitness/connectedfitness-v2/node_modules/@notum-cz/strapi-plugin-content-versioning/node_modules/@strapi/design-system doesn't exist /Users/jordanschinella/Sites/connectedfitness/connectedfitness-v2/node_modules/@notum-cz/node_modules doesn't exist or is not a directory /Users/jordanschinella/Sites/connectedfitness/connectedfitness-v2/node_modules/node_modules doesn't exist or is not a directory looking for modules in /Users/jordanschinella/Sites/connectedfitness/connectedfitness-v2/node_modules existing directory /Users/jordanschinella/Sites/connectedfitness/connectedfitness-v2/node_modules/@strapi/design-system using description file: /Users/jordanschinella/Sites/connectedfitness/connectedfitness-v2/node_modules/@strapi/design-system/package.json (relative path: .) using description file: /Users/jordanschinella/Sites/connectedfitness/connectedfitness-v2/node_modules/@strapi/design-system/package.json (relative path: ./Text) no extension Field 'browser' doesn't contain a valid alias configuration /Users/jordanschinella/Sites/connectedfitness/connectedfitness-v2/node_modules/@strapi/design-system/Text doesn't exist .js Field 'browser' doesn't contain a valid alias configuration /Users/jordanschinella/Sites/connectedfitness/connectedfitness-v2/node_modules/@strapi/design-system/Text.js doesn't exist .jsx Field 'browser' doesn't contain a valid alias configuration /Users/jordanschinella/Sites/connectedfitness/connectedfitness-v2/node_modules/@strapi/design-system/Text.jsx doesn't exist .react.js Field 'browser' doesn't contain a valid alias configuration /Users/jordanschinella/Sites/connectedfitness/connectedfitness-v2/node_modules/@strapi/design-system/Text.react.js doesn't exist as directory /Users/jordanschinella/Sites/connectedfitness/connectedfitness-v2/node_modules/@strapi/design-system/Text doesn't exist /Users/jordanschinella/Sites/connectedfitness/node_modules doesn't exist or is not a directory /Users/jordanschinella/Sites/node_modules doesn't exist or is not a directory /Users/jordanschinella/node_modules doesn't exist or is not a directory /Users/node_modules doesn't exist or is not a directory /node_modules doesn't exist or is not a directory looking for modules in /Users/jordanschinella/Sites/connectedfitness/connectedfitness-v2/node_modules/@strapi/admin/node_modules /Users/jordanschinella/Sites/connectedfitness/connectedfitness-v2/node_modules/@strapi/admin/node_modules/@strapi/design-system doesn't exist ModuleNotFoundError: Module not found: Error: Can't resolve '@strapi/design-system/Text' in '/Users/jordanschinella/Sites/connectedfitness/connectedfitness-v2/node_modules/@notum-cz/strapi-plugin-content-versioning/admin/src/components/Versions' at /Users/jordanschinella/Sites/connectedfitness/connectedfitness-v2/node_modules/webpack/lib/Compilation.js:2011:28 at /Users/jordanschinella/Sites/connectedfitness/connectedfitness-v2/node_modules/webpack/lib/NormalModuleFactory.js:795:13 at eval (eval at create (/Users/jordanschinella/Sites/connectedfitness/connectedfitness-v2/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:10:1) at /Users/jordanschinella/Sites/connectedfitness/connectedfitness-v2/node_modules/webpack/lib/NormalModuleFactory.js:275:22 at eval (eval at create (/Users/jordanschinella/Sites/connectedfitness/connectedfitness-v2/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:9:1) at /Users/jordanschinella/Sites/connectedfitness/connectedfitness-v2/node_modules/webpack/lib/NormalModuleFactory.js:431:22 at /Users/jordanschinella/Sites/connectedfitness/connectedfitness-v2/node_modules/webpack/lib/NormalModuleFactory.js:124:11 at /Users/jordanschinella/Sites/connectedfitness/connectedfitness-v2/node_modules/webpack/lib/NormalModuleFactory.js:667:25 at /Users/jordanschinella/Sites/connectedfitness/connectedfitness-v2/node_modules/webpack/lib/NormalModuleFactory.js:852:8 at /Users/jordanschinella/Sites/connectedfitness/connectedfitness-v2/node_modules/webpack/lib/NormalModuleFactory.js:972:5 at /Users/jordanschinella/Sites/connectedfitness/connectedfitness-v2/node_modules/neo-async/async.js:6883:13 at /Users/jordanschinella/Sites/connectedfitness/connectedfitness-v2/node_modules/webpack/lib/NormalModuleFactory.js:955:45 at finishWithoutResolve (/Users/jordanschinella/Sites/connectedfitness/connectedfitness-v2/node_modules/enhanced-resolve/lib/Resolver.js:312:11) at /Users/jordanschinella/Sites/connectedfitness/connectedfitness-v2/node_modules/enhanced-resolve/lib/Resolver.js:386:15 at /Users/jordanschinella/Sites/connectedfitness/connectedfitness-v2/node_modules/enhanced-resolve/lib/Resolver.js:435:5 at eval (eval at create (/Users/jordanschinella/Sites/connectedfitness/connectedfitness-v2/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:15:1) resolve '@strapi/design-system/Text' in '/Users/jordanschinella/Sites/connectedfitness/connectedfitness-v2/node_modules/@notum-cz/strapi-plugin-content-versioning/admin/src/components/Versions' Parsed request is a module using description file: /Users/jordanschinella/Sites/connectedfitness/connectedfitness-v2/node_modules/@notum-cz/strapi-plugin-content-versioning/package.json (relative path: ./admin/src/components/Versions) Field 'browser' doesn't contain a valid alias configuration resolve as module /Users/jordanschinella/Sites/connectedfitness/connectedfitness-v2/node_modules/@notum-cz/strapi-plugin-content-versioning/admin/src/components/Versions/node_modules doesn't exist or is not a directory /Users/jordanschinella/Sites/connectedfitness/connectedfitness-v2/node_modules/@notum-cz/strapi-plugin-content-versioning/admin/src/components/node_modules doesn't exist or is not a directory /Users/jordanschinella/Sites/connectedfitness/connectedfitness-v2/node_modules/@notum-cz/strapi-plugin-content-versioning/admin/src/node_modules doesn't exist or is not a directory /Users/jordanschinella/Sites/connectedfitness/connectedfitness-v2/node_modules/@notum-cz/strapi-plugin-content-versioning/admin/node_modules doesn't exist or is not a directory looking for modules in /Users/jordanschinella/Sites/connectedfitness/connectedfitness-v2/node_modules/@notum-cz/strapi-plugin-content-versioning/node_modules /Users/jordanschinella/Sites/connectedfitness/connectedfitness-v2/node_modules/@notum-cz/strapi-plugin-content-versioning/node_modules/@strapi/design-system doesn't exist /Users/jordanschinella/Sites/connectedfitness/connectedfitness-v2/node_modules/@notum-cz/node_modules doesn't exist or is not a directory /Users/jordanschinella/Sites/connectedfitness/connectedfitness-v2/node_modules/node_modules doesn't exist or is not a directory looking for modules in /Users/jordanschinella/Sites/connectedfitness/connectedfitness-v2/node_modules existing directory /Users/jordanschinella/Sites/connectedfitness/connectedfitness-v2/node_modules/@strapi/design-system using description file: /Users/jordanschinella/Sites/connectedfitness/connectedfitness-v2/node_modules/@strapi/design-system/package.json (relative path: .) using description file: /Users/jordanschinella/Sites/connectedfitness/connectedfitness-v2/node_modules/@strapi/design-system/package.json (relative path: ./Text) no extension Field 'browser' doesn't contain a valid alias configuration /Users/jordanschinella/Sites/connectedfitness/connectedfitness-v2/node_modules/@strapi/design-system/Text doesn't exist .js Field 'browser' doesn't contain a valid alias configuration /Users/jordanschinella/Sites/connectedfitness/connectedfitness-v2/node_modules/@strapi/design-system/Text.js doesn't exist .jsx Field 'browser' doesn't contain a valid alias configuration /Users/jordanschinella/Sites/connectedfitness/connectedfitness-v2/node_modules/@strapi/design-system/Text.jsx doesn't exist .react.js Field 'browser' doesn't contain a valid alias configuration /Users/jordanschinella/Sites/connectedfitness/connectedfitness-v2/node_modules/@strapi/design-system/Text.react.js doesn't exist as directory /Users/jordanschinella/Sites/connectedfitness/connectedfitness-v2/node_modules/@strapi/design-system/Text doesn't exist /Users/jordanschinella/Sites/connectedfitness/node_modules doesn't exist or is not a directory /Users/jordanschinella/Sites/node_modules doesn't exist or is not a directory /Users/jordanschinella/node_modules doesn't exist or is not a directory /Users/node_modules doesn't exist or is not a directory /node_modules doesn't exist or is not a directory looking for modules in /Users/jordanschinella/Sites/connectedfitness/connectedfitness-v2/node_modules/@strapi/admin/node_modules /Users/jordanschinella/Sites/connectedfitness/connectedfitness-v2/node_modules/@strapi/admin/node_modules/@strapi/design-system doesn't exist npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! [email protected] build:
strapi build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/jordanschinella/.npm/_logs/2022-03-18T15_24_23_631Z-debug.log`
A clear and concise description of what the bug is.
npm run build --clean
build completes successfully
I have installed the plugin but it's not showing me the option for versioning.
what do I do?
I have an issue regarding the way the plugin version the entities with its internal identifier. I was testing it in some branch, and I change to other branch where the plugin was not activated yet because it was in a older version of the project.I found that the entities that where versioned were now in the admin panel like 'normal' entities. I changed again to the branch with the plugin (with the enabled: true
attribute inside the plugin.js) and now the entities that were versioned are not acting like versioned anymore. I check the database and the vuid
that seems to identify the group of entities is empty so there is no way to identify those entities that were versioned before.
To reproduce the error:
It should maintain the previous state of the application in case you accidentally change to some branch or part of your project that does not have the plugin yet or you deactivated for some reason.
In the picture, the ones with vuid
are currently working and were added after I deactivated/activated the plugin. The ones that don't have vuid are added before I deactivated/activated the plugin.
strapi Version 4.9.1,
Node Version : v14.19.1
As as strapi admin i need to save the different version of content with internationalisation(i18n). Currently I can only use the default local (english en).
Hello! I hope you don't mind an issue for this not yet released plugin. Consider it an Alpha QA report :-)
I am very keen on this project, so I have done a bit of testing and just wanted to let you know the experience.
created_by_id
and updated_by_id
columns in DB are not set."postinstall": "patch-package",
is needed in package.json
. Mention in readme?If Strapi is using postgres db schema other than the default public or the one named the same as the db user e.g. DB_USERNAME=strapi SCHEMA_NAME=strapi, it fails in places where custom SQL queries are written, e.g. beforeUpdate.js lifecycle hook or beforeDelete.js hook.
User should be able to delete or update/publish versioned entry
// Relink logic for localizations
if (isLocalized) {
const latestInLocales = (await strapi.db.connection.raw(
`SELECT DISTINCT ON (locale) id, locale, version_number, published_at FROM ${collectionName} // missing schema name
WHERE vuid='${item.vuid}' AND id!='${item.id}'
ORDER BY locale, published_at DESC NULLS LAST, version_number DESC`
same applies for beforeUpdate.js
When disabling plugin in admin throws 500 on removing entries
When attempting to duplicate item in the content manager, the new saved entry is treated as another version of an existing item instead of a separate item.
A new item is created with the data from the duplicated item.
The data is saved as a new version of the duplicated item.
I have been trying to work with content versioning plugin for so long but even after installing the plugin and enabling it in the plugins.js it is not working or not showing any changes in content-type as before creating the collection-type or single-type we have to enable content-versioning just like i18n but that option is not available there, but when I open up the watch-admin mode I get to see that enable content versioning option and it is working fine in watch-admin mode.
I would like to know if there's gonna be a release for the compatibility for Strapi V3?
"Saved" message shown, no "Are you sure..." shown.
All the versions are visible in collection list view.
In other words rows with "isVisibleInListView: false" are visible in the collection list view
The bug occurred after I updated to Strapi from 4.4.5 to 4.8.2
I also reproduce the bug on a fresh Strapi 4.8.2 installation
Only "the main" version of each entry should be visible in the collection list view
In other words only rows with "isVisibleInListView: true" should be visible in the collection list view
It used to work for me on Strapi v4.4.5
If a content type has a field declared as "Unique Field" in the Content type builder, saving new versions after the initial v1 fails with
Validation Error: This field must be unique
When create new Content-Type include number, table name will be split with "_". and save a new version of content-type ,will be get error. For detail please see below.
Data table names should be consistent
If applicable, add code samples to help explain your problem.
Warning: Policy Failed.
If I as Super Admin disable versioning on the Content Type and reload the Editor users browser, the editor can again create new items.
I've overwritten the default functionality of the Save-button (following these instructions), to save a new version when you click the native Save-button.
It seems to work fine. However, the version date does not get updated. So if I hit "Save" on an entry with the timestamp X showing under "Showed version", the new version would also get timestamp X. This kind of breaks the purpose of the timestamp.
I'm using the 4.6.0 patch, with Strapi 4.6.0 and content versioning 1.0.0-beta.0.
When using the "Save new version" button, the timestamp is properly set to the timestamp when I clicked the button.
I expect a new timestamp to be generated and set to the new version, like the "Save new version" button would do.
The "Showed Version" shows Dec 23 2022, even though I just saved this version using the native Save button (Feb 22 2023).
Node.js version: 16.18.1
NPM version: 8.19.2
Strapi version: 4.5.0
Database: postgres
Operating system: OSX 12.15.1
When saving new versions the created_by_id and updated_by_id columns in DB are not set.
System
Node.js version: v16
Strapi version: v4.0.6
Database: Postgres
Operating system: MacOS
Add any other context about the problem here.
Since Strapi 4.1.7 the supplied patch package no longer applies without errors.
Hi,
I've installed your module on the last Strapi 4.3.8 version , unfortunately, the module doesn't appear in the catalog.
Reading the first step is about "Versioning must be enabled in settings of Content Type. Same as localization plugin."
Unfortunately, I didn't see any flag in the popup of Advanced settings.
Is there any workaround I can do setting a row in the db or config file in order to enable first step?
Moreover the patch is not available for 4.3.8, I've renamed 4.3.6 version, is it ok?
Thanks
Maurizio
The original query was
INSERT INTO ${model.collectionName}_versions_links VALUES (${version},${result.id})
and I had a problem creating a new version I kept getting a 500 error from the server, eventually changing query to node_modules/@notum-cz/strapi-plugin-content-versioning/server/services/core-api.js for INSERT INTO ${model.collectionName}_versions_links (post_id, inv_post_id) VALUES (${version}, ${result.id})
helped.
Internal server while Saving new version
Should save the new version
I was eventually able to successfully install this plugin by reverting to Strapi 4.0.2, however I'm not able to access any of the alternate version content in the API? Is it expected that we should be able to, or is the intent of this plugin only to be able to access the multiple versions within the Strapi admin interface?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.