-
Notifications
You must be signed in to change notification settings - Fork 180
Closed
Description
Hi,
To create or update a wiki page, you have to use PUT method instead of POST.
I remove in my case the cleanParams function because it's not present in the Wiki class nor AbstractApi and I don't need it.
/**
* Create a new issue given an array of $params
* The issue is assigned to the authenticated user.
* @link http://www.redmine.org/projects/redmine/wiki/Rest_Issues#Creating-an-issue
*
* @param int|string $project the project name
* @param string $page the page name
* @param array $params the new issue data
* @return \SimpleXMLElement
*/
public function create($project, $page, array $params = array())
{
$defaults = array(
'text' => null,
'comments' => null,
'version' => null,
);
//$params = $this->cleanParams($params);
$params = array_filter(array_merge($defaults, $params));
$xml = new \SimpleXMLElement('');
foreach ($params as $k => $v) {
$xml->addChild($k, $v);
}
return $this->put('/projects/'.$project.'/wiki/'.$page.'.xml', $xml->asXML());
}
PS : In my case (again ;) ) I replace
$c = 'Api'.$classes[$name];by
$c = 'Redmine\Api'.$classes[$name];in Client.php
BR
Metadata
Metadata
Assignees
Labels
No labels