diff --git a/.gitea/workflows/ci.yaml b/.gitea/workflows/ci.yaml index 116c897..0fa63a0 100644 --- a/.gitea/workflows/ci.yaml +++ b/.gitea/workflows/ci.yaml @@ -11,7 +11,7 @@ jobs: strategy: fail-fast: false matrix: - php-version: ['8.2', '8.4'] + php-version: ['8.2', '8.5'] # db-type: ['mysql'] db-type: ['sqlite', 'mysql', 'pgsql'] prefer-lowest: [''] diff --git a/src/Controller/CartItemsController.php b/src/Controller/CartItemsController.php index a7a234a..f2cc435 100644 --- a/src/Controller/CartItemsController.php +++ b/src/Controller/CartItemsController.php @@ -87,10 +87,7 @@ class CartItemsController extends AppController { public function edit($id = null) { $this->request->allowMethod(['post', 'put', 'patch']); - $cartItem = $this->CartItems->find() - ->where(['CartItems.id' => $id]) - ->contain(['Carts']) - ->firstOrFail(); + $cartItem = $this->CartItems->get($id, contain: ['Carts']); $this->ShoppingCart->checkIfIsOwnCart($cartItem->cart); @@ -135,13 +132,9 @@ class CartItemsController extends AppController { $this->request->allowMethod(['post', 'delete']); $identity = $this->getRequest()->getAttribute('identity'); -// $cart = $this->viewBuilder()->getVar('cart'); - $cartItem = $this->CartItems->find() - ->where(['CartItems.id' => $id]) - ->contain(['Carts']) - ->firstOrFail(); + $cartItem = $this->CartItems->get($id, contain: ['Carts']); - $this->ShoppingCart->checkIfIsOwnCart($cartItem->cart); + $this->ShoppingCart->checkIfIsOwnCart($cartItem->cart); unset($cartItem->cart); if ($this->CartItems->delete($cartItem)) {