Opened 15 years ago
Closed 14 years ago
#12947 closed defect (bug) (fixed)
Slugs are reset when updating post via XML-RPC
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 3.2 | Priority: | normal |
Severity: | major | Version: | 2.9.2 |
Component: | XML-RPC | Keywords: | has-patch |
Focuses: | Cc: |
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)
#2
@
15 years ago
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 :-)
#5
@
14 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
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.