Skip to content

Commit 3e54a46

Browse files
committed
fix(wordpress): don't clear category/tag description on update when field left blank
description used !== undefined (numeric-field convention) instead of a truthy check (string-field convention used everywhere else in this codebase, e.g. update_post/update_page excerpt), so an untouched empty description field silently wiped existing text on every update. Flagged by Cursor Bugbot.
1 parent 14ead53 commit 3e54a46

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

apps/sim/tools/wordpress/update_category.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ export const updateCategoryTool: ToolConfig<
7070
const body: Record<string, any> = {}
7171

7272
if (params.name) body.name = params.name
73-
if (params.description !== undefined) body.description = params.description
73+
if (params.description) body.description = params.description
7474
if (params.parent !== undefined) body.parent = params.parent
7575
if (params.slug) body.slug = params.slug
7676

apps/sim/tools/wordpress/update_tag.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ export const updateTagTool: ToolConfig<WordPressUpdateTagParams, WordPressUpdate
6161
const body: Record<string, any> = {}
6262

6363
if (params.name) body.name = params.name
64-
if (params.description !== undefined) body.description = params.description
64+
if (params.description) body.description = params.description
6565
if (params.slug) body.slug = params.slug
6666

6767
return body

0 commit comments

Comments
 (0)