-
Notifications
You must be signed in to change notification settings - Fork 10
Fix/migrate versioning 3.6.8 #59
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
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Maksymilian Pamuła <[email protected]>
Signed-off-by: Maksymilian Pamuła <[email protected]>
…d - when fetch relation Signed-off-by: Maksymilian Pamuła <[email protected]>
Signed-off-by: Maksymilian Pamuła <[email protected]>
Hey @Kronos66 I tried this PR and I can actually see the versions dropdown now, but no data are saved in the db table On a single types (named |
Signed-off-by: Maksymilian Pamuła <[email protected]>
Hi @vuolter, I added support for single types. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @Kronos66, I tested your latest changes and by applying just a few small changes I was able to get the plugin finally working fine on my side. Thanks for your amazing support! ❤️
const { id: singleTypeId } = await model.findOne({}); | ||
knexQueryBuilder | ||
.where({ content_type: contentType, entity_id: singleTypeId }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to check if the query returns actually an entry, I changed this block to:
const entry = await model.findOne({});
if (entry) {
knexQueryBuilder.where({
content_type: contentType,
entity_id: entry.id,
});
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch I will fix this in next commit :) thank you
return versionsForCurrentId.map((el) => ({ | ||
content: el.entity, | ||
return versionsForCurrentContentType.map((el) => ({ | ||
content: JSON.parse(el.entity), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like el.entity
is already an object, I reverted to:
content: el.entity,
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Strange, because we write data to database as json and here we always get string
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have one question about this problem, what database do you use?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
postgresql
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If i remember correctly this happens also with built-in sqlite @Kronos66
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, @vuolter , sorry for delay
I added the saveParse
method to handle objects, now everything should works correctly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @Kronos66, sorry to reply so late.... I tried your latest changes under sqlite and mysql on a fresh installation and everything looks working fine, on both.
I'll try to check on postgresql as well and let you know.
Signed-off-by: Maksymilian Pamuła <[email protected]>
Signed-off-by: Maksymilian Pamuła <[email protected]>
I am getting TypeError: Cannot read property 'listEntityVersions' of undefined when I try to spin it up, but if I remove the first route in the routes.json file, I can spin up my environment, however, it is unable to get the versions of the collection types. Has anyone else gotten this or know how to fix it?
|
What's the status on this @Kronos66 ? I need versioning in an app, if this works it'd be great :) |
No description provided.