Opened 3 years ago

Closed 2 years ago

#12947 closed defect (bug) (fixed)

Slugs are reset when updating post via XML-RPC

Reported by: cfinke Owned by: josephscott
Priority: normal Milestone: 3.2
Component: XML-RPC Version: 2.9.2
Severity: major Keywords: has-patch
Cc: n.prasath.002@…, joseph@…

Description

  1. 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."
  2. Edit that post via the XML-RPC API, but don't send a new value (or even mention) the wp_slug field.
  3. 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)

post-slug-reset.diff (478 bytes) - added by nprasath002 2 years ago.

Download all attachments as: .zip

Change History (9)

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.

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 :-)

  • Milestone changed from Awaiting Review to Future Release
  • Keywords needs-patch added; xmlrpc, scribefire, slug removed
  • 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

  • Keywords needs-patch removed
  • 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.

  • Resolution set to fixed
  • Status changed from new to closed

(In [17648]) Don't reset the post slug on XML-RPC calls.

Fixes #12947 props cfinke, nprasath002

Note: See TracTickets for help on using tickets.