WordPress.org

Make WordPress Core

Opened 7 years ago

Closed 7 years ago

#4582 closed defect (bug) (invalid)

XMLRPC editPage does not record custom slug

Reported by: spaceboy Owned by: josephscott
Milestone: Priority: normal
Severity: normal Version: 2.2.1
Component: XML-RPC Keywords:
Focuses: Cc:

Description

Hi,

I'm using WP 2.2.1, and am trying to edit a page using the XMLRPC interface. I can successfully change the title, description and author, but not the slug. In my case, the Slug defaults to the Page Title (separated by dashes).

The data structure that I'm using to pass to the XMLRPC wp.editPage API is:

$input = Array (
new xmlrpcval($this->_blog_id, 'int'),
new xmlrpcval($this->_page_id, 'int'),
new xmlrpcval(WP_USERNAME, 'string'),
new xmlrpcval(WP_PASSWORD, 'string'),
new xmlrpcval(
Array(
'wp_slug' => new xmlrpcval($this->_slug, 'string'),
'wp_page_parent_id' => new xmlrpcval($this->_page_parent_id, 'int'),
'wp_author_id' => new xmlrpcval($this->_author_id, 'int'),
'title' => new xmlrpcval($this->_title, 'string'),
'description' => new xmlrpcval($this->_content, 'string'),
'mt_allow_comments' => new xmlrpcval($this->_allow_comments, 'int'),
'mt_allow_pings' => new xmlrpcval($this->_allow_pings, 'int')
),
'struct'
),
new xmlrpcval($this->_publish, 'boolean')
);

I've debugged the code to the point of tracing the editPage flow to wp_insert_post() function, and the $post_name is the same slug name passed in via the XMLRPC call.

Could the slug name change down stream somehow?

Note: I can add a new page (via XMLRPC) with the custom slug name successfully.

Also, this could be related to another defect (not sure if a ticket exists or not) where approving/disapproving post comments changes the slug to the post title name (i.e. post name with dashes). This is the same behavior as the editPage XMLRPC command.

Thanks,
Rob.

Change History (5)

comment:1 redsweater7 years ago

  • Cc redsweater added

comment:2 foolswisdom7 years ago

  • Owner changed from anonymous to josephscott

comment:3 in reply to: ↑ description spaceboy7 years ago

Like to add this is related to:

http://trac.wordpress.org/ticket/3912. Will try disabling all plugins, and retest.

Replying to spaceboy:

comment:4 spaceboy7 years ago

  • Priority changed from high to normal
  • Severity changed from critical to normal

It works after disabling the Singular plugin. I can successfully edit the page (via XMLRPC), keeping the same custom slug name.

The plugin version installed with WP2.2.1 is 0.5. Therefore, I assume this is a plugin defect with Singular?

comment:5 markjaquith7 years ago

  • Milestone 2.2.2 deleted
  • Resolution set to invalid
  • Status changed from new to closed

Your reasoning is sound. Singular makes the mistake of thinking that every time edit_post or publish_post is called that you are editing the post from within the WP admin.

Note: See TracTickets for help on using tickets.