Opened 3 years ago
Closed 2 years ago
#12947 closed defect (bug) (fixed)
Slugs are reset when updating post via XML-RPC
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Priority: | normal | Milestone: | 3.2 |
| Component: | XML-RPC | Version: | 2.9.2 |
| Severity: | major | Keywords: | has-patch |
| Cc: | n.prasath.002@…, joseph@… |
Description
- Publish a post from the Web dashboard, and give it a custom slug. e.g., "my-custom-slug" for a post titled "How to use custom slugs."
- Edit that post via the XML-RPC API, but don't send a new value (or even mention) the wp_slug field.
- The post's slug will be reset to "how-to-use-custom-slugs"
Here's the XML I sent when editing the post (generated by ScribeFire for Chrome, which I'm currently writing):
<?xml version="1.0" encoding="UTF-8" ?>
<methodCall>
<methodName><![CDATA[metaWeblog.editPost]]></methodName>
<params>
<param>
<value>
<string><![CDATA[1126]]></string>
</value>
</param>
<param><value><string><![CDATA[cfinke]]></string></value></param>
<param><value><string><![CDATA[XXXXXXX]]></string></value></param>
<param>
<value>
<struct>
<member><name>title</name><value><string><![CDATA[How to use custom slugs.]]></string></value></member>
<member><name>description</name><value><string><![CDATA[<p> This is a test. Testing. Testing.</p>]]></string></value></member>
<member><name>categories</name><value><array><data><value><string><![CDATA[Life]]></string></value></data></array></value></member>
<member><name>mt_keywords</name><value><string><![CDATA[]]></string></value></member>
</struct>
</value>
</param>
<param>
<value><boolean>1</boolean></value>
</param>
</params>
</methodCall>
Attachments (1)
Change History (9)
I would expect if the client didn't provide a value for the slug field that it would not be modified.
A patch which implemented this would be great :-)
nprasath002 — 2 years ago
comment:5
nprasath002 — 2 years ago
- Cc n.prasath.002@… added
- Keywords has-patch added
In editing posts if the slug was not mentioned
we should get the current postname not set it to blank.
Tested with a java client and works fine
comment:6
nprasath002 — 2 years ago
- Keywords needs-patch removed
comment:7
josephscott — 2 years ago
- Cc joseph@… added
- Milestone changed from Future Release to 3.2
+1 to this, the proposed patch solves the issue. Going to mark this as a potential WP 3.2 item.
comment:8
josephscott — 2 years ago
- Resolution set to fixed
- Status changed from new to closed

My guess is the application itself has to pull, keep, and update the slug, but it depends on whether WP devs meant this to be by design or not. Curious to see their feedback.