zfcampus / zf-hal

BSD 3-Clause "New" or "Revised" License
30 stars 49 forks source link

Update zf-hal `ZF\Hal\Plugin` to support resources with $id = 0 #44

Closed Wilt closed 10 years ago

Wilt commented 10 years ago

I have some resources with identifier $id = 0. This is currently not rendering correctly inside ZF\Hal\Plugin\Hal.

This is related to the createEntity method on line 751 in ZF\Hal\Plugin\Hal which should explicitly check if ($id === false) in the if clause on line 763 instead of the if($id). Right now the method wrongly returns an ApiProblem if the entity has $id = 0.

Link to ZF\Hal\Plugin\Hal:createEntity: https://github.com/zfcampus/zf-hal/blob/master/src/Plugin/Hal.php#L751

Also check related issue in zf-hal: https://github.com/zfcampus/zf-rest/issues/35

weierophinney commented 10 years ago

Closed with #45