Skip to content
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.

Commit

Permalink
Merge branch 'hotfix/revert-7255'
Browse files Browse the repository at this point in the history
Reverts #7255
Prepares for 2.3.7
  • Loading branch information
weierophinney committed Mar 12, 2015
2 parents 97f67e0 + 503a2fd commit a1aae5f
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 32 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,9 @@
# CHANGELOG

## 2.3.7 (2015-03-12)

- [7255: Revert BC break against AbstractRestfulController](https://github.com/zendframework/zf2/pull/7255)

## 2.3.6 (2015-03-12)

### SECURITY UPDATES
Expand Down
7 changes: 5 additions & 2 deletions README.md
Expand Up @@ -11,14 +11,17 @@ Develop:

## RELEASE INFORMATION

*Zend Framework 2.3.7dev*
*Zend Framework 2.3.7*

This is the seventh maintenance release for the version 2.3 series.

DD MMM YYYY
12 Mar 2015

### UPDATES IN 2.3.7

- This release reverts [#7255](https://github.com/zendframework/zf2/pull/7255),
as it introduced a BC break against `Zend\Mvc\Controller\AbstractRestfulController`.

Please see [CHANGELOG.md](CHANGELOG.md).

### SYSTEM REQUIREMENTS
Expand Down
6 changes: 2 additions & 4 deletions library/Zend/Mvc/Controller/AbstractRestfulController.php
Expand Up @@ -116,7 +116,7 @@ public function delete($id)
*
* @return mixed
*/
public function deleteList($data)
public function deleteList()
{
$this->response->setStatusCode(405);

Expand Down Expand Up @@ -347,16 +347,14 @@ public function onDispatch(MvcEvent $e)
// DELETE
case 'delete':
$id = $this->getIdentifier($routeMatch, $request);
$data = $this->processBodyContent($request);

if ($id !== false) {
$action = 'delete';
$return = $this->delete($id);
break;
}

$action = 'deleteList';
$return = $this->deleteList($data);
$return = $this->deleteList();
break;
// GET
case 'get':
Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Version/Version.php
Expand Up @@ -20,7 +20,7 @@ final class Version
/**
* Zend Framework version identification - see compareVersion()
*/
const VERSION = '2.3.7dev';
const VERSION = '2.3.7';

/**
* Github Service Identifier for version information is retrieved from
Expand Down
14 changes: 2 additions & 12 deletions tests/ZendTest/Mvc/Controller/RestfulControllerTest.php
Expand Up @@ -137,19 +137,9 @@ public function testDispatchInvokesDeleteMethodWhenNoActionPresentAndDeleteInvok

public function testDispatchInvokesDeleteListMethodWhenNoActionPresentAndDeleteInvokedWithoutIdentifier()
{
$entities = array(
array('id' => uniqid(), 'name' => __FUNCTION__),
array('id' => uniqid(), 'name' => __FUNCTION__),
array('id' => uniqid(), 'name' => __FUNCTION__),
);

$this->controller->entity = $entities;

$string = http_build_query($entities);
$this->request->setMethod('DELETE')
->setContent($string);
$this->request->setMethod('DELETE');
$result = $this->controller->dispatch($this->request, $this->response);
$this->assertEmpty($this->controller->entity);
$this->assertSame($this->response, $result);
$this->assertEquals(204, $result->getStatusCode());
$this->assertTrue($result->getHeaders()->has('X-Deleted'));
$this->assertEquals('deleteList', $this->routeMatch->getParam('action'));
Expand Down
Expand Up @@ -49,23 +49,11 @@ public function delete($id)
*
* @return \Zend\Http\Response
*/
public function deleteList($data)
public function deleteList()
{
if (is_array($this->entity)) {
foreach ($data as $row) {
foreach ($this->entity as $index => $entity) {
if ($row['id'] == $entity['id']) {
unset($this->entity[$index]);
break;
}
}
}
}

$response = $this->getResponse();
$response->setStatusCode(204);
$response->getHeaders()->addHeaderLine('X-Deleted', 'true');

return $response;
}

Expand Down

0 comments on commit a1aae5f

Please sign in to comment.