-
-
Notifications
You must be signed in to change notification settings - Fork 15
✨ Make find-replace safer by default by enabling post revisions for changes by defaults. #698
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: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -141,7 +141,8 @@ const getFullTaskList = (options) => { | |
| delete post.matchesByField; | ||
|
|
||
| try { | ||
| let result = await ctx.api.posts.edit(post); | ||
| let queryParams = ctx.args.saveRevision ? {save_revision: true} : {}; | ||
| let result = await ctx.api.posts.edit(post, queryParams); | ||
|
Comment on lines
+144
to
+145
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Enforce Line 144 relies on 💡 Suggested patch let defaults = {
verbose: false,
tag: false,
- delayBetweenCalls: 50
+ delayBetweenCalls: 50,
+ saveRevision: true
};🤖 Prompt for AI Agents |
||
| ctx.updated.push(result.url); | ||
| return Promise.delay(options.delayBetweenCalls).return(result); | ||
| } catch (error) { | ||
|
|
||
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.
🧩 Analysis chain
🌐 Web query:
Ghost GitHub issue 26677 save_revision false not taking effect💡 Result:
In Ghost v6.20.0, this is a confirmed bug: the Admin API can create new post revisions even when you send
?save_revision=false(or0). The issue report (#26677, opened Mar 3, 2026) explains that Ghost’s revision logic picks the wrong “latest” revision due to an ordering mismatch (revisions are fetched newest-first, but the code treats the last array element as “latest”). That makes the “background save” time check almost always pass, so revisions get saved whenever content changes—ignoringsave_revision=false. [1]What you can do
needs:triageand, as of the report, has no assignee/milestone). [1]Note
You may see
save_revision=1in normal Ghost Admin traffic—Ghost Admin appears to always sendsave_revision=true, which masks this bug for most UI usage. [1][2]Sources: GitHub issue
#26677[1], related Ghost editor request example showingsave_revisionusage [2].Document known Ghost limitation with
--no-saveRevision.Line 447 documents
--no-saveRevisionwithout noting that this feature is non-functional due to a confirmed bug in Ghost v6.20.0+ (issue#26677). The Admin API ignores thesave_revision=falseparameter due to a revision ordering logic error. Users should be warned that revisions will be saved regardless until Ghost upstream releases a fix. Consider adding a brief note to manage expectations.🤖 Prompt for AI Agents