Save an element in Craft CMS without creating a revision #13075
Replies: 1 comment
-
Little hacky, but entries will only create new revisions when they aren’t being “resaved”, so you could pretend that’s the cased to opt out of the revision creation: $project->setFieldValue('chartImageDetails', [$asset->id]);
$project->resaving = true;
Craft::$app->elements->saveElement($project); |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Is it possible to save an element in Craft CMS without creating a revision? Sometimes I don't want to create a revision based on the parameters. Here's an example of my code:
Thanks
Beta Was this translation helpful? Give feedback.
All reactions