Fix PHRAS-146 Order of a basket generates an error when the content comes from two different collections

This commit is contained in:
Nicolas Le Goff
2014-05-30 17:32:24 +02:00
parent e5b8817c46
commit d42f27ad40

View File

@@ -155,9 +155,10 @@ class Order implements ControllerProviderInterface
try {
$records = RecordsRequest::fromRequest($app, $request, true, array('cancmd'));
$query = new \User_Query($app);
foreach ($records as $key => $record) {
$query = new \User_Query($app);
if ($collectionHasOrderAdmins->containsKey($record->get_base_id())) {
if (!$collectionHasOrderAdmins->get($record->get_base_id())) {
$records->remove($key);
@@ -182,8 +183,8 @@ class Order implements ControllerProviderInterface
}
$noAdmins = $collectionHasOrderAdmins->forAll(function ($key, $hasAdmin) {
return false === $hasAdmin;
});
return false === $hasAdmin;
});
if ($noAdmins) {
$msg = _('There is no one to validate orders, please contact an administrator');