Problem/Motivation
When creating a node with services, for example of type article, setting node body format to "filtered_html", with a user that doesn't have "use filtered html" permission, the node gets created and the body format is set to "plain_text"
Steps to reproduce:
0) Create user who can create articles, but cant use filtered html
1) Using services, create a node, for example of type article, and set it's body format to filtered_html.
2) The node gets created by services, but the body format is plain_text
Proposed resolution
The service should return an error instead:
"Can't create node, not enough priviliges: filtered_html missing" or something like that.
Remaining tasks
N/A
User interface changes
N/A
API changes
N/A
Original report by [username]
N/A
Portion of php code to reproduce the issue:
$node_data = array(
'type' => 'article',
'title' => 'my title',
'body[und][0]' => array('format' => 'filtered_html','value' => 'strong: <strong>boom</strong>'),
);
$node_data = http_build_query($node_data, '', '&');
$curl = curl_init($service_url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_COOKIE, "$session_cookie");
curl_setopt($curl, CURLOPT_HTTPHEADER, array( 'X-CSRF-Token: '. $session_token ));
//curl_setopt($curl, 'X-CSRF-Token', "$session_token");
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, $node_data);
curl_setopt($curl, CURLOPT_VERBOSE, true);
$response = curl_exec($curl);
curl_close($curl);
Comments
Comment #1
tunele CreditAttribution: tunele commentedComment #2
tunele CreditAttribution: tunele commentedComment #3
kylebrowning CreditAttribution: kylebrowning as a volunteer and at Acquia commentedIf someone wants to provide a patch were happy to take a look, but currently this is a wont fix due to time, and focus on Drupal 8.