wip first not first or fail attributes form
CI / testsuite (mysql, 8.1, ) (push) Failing after 0s Details
CI / testsuite (mysql, 8.4, ) (push) Failing after 0s Details
CI / testsuite (pgsql, 8.1, ) (push) Failing after 0s Details
CI / testsuite (pgsql, 8.4, ) (push) Failing after 1s Details
CI / testsuite (sqlite, 8.1, ) (push) Failing after 1s Details
CI / testsuite (sqlite, 8.1, prefer-lowest) (push) Failing after 0s Details
CI / testsuite (sqlite, 8.4, ) (push) Failing after 0s Details
CI / Coding Standard & Static Analysis (push) Failing after 0s Details

This commit is contained in:
Brandon Shipley 2025-04-01 02:37:58 -07:00
parent 56e526bc0f
commit 9f94f7d0ed
Signed by: bmfs
GPG Key ID: 14E38571D8BB0DE4
2 changed files with 8 additions and 2 deletions

View File

@ -167,6 +167,9 @@ class ProductCategoryAttributesController extends AppController
return $this->redirect(['action' => 'index']); return $this->redirect(['action' => 'index']);
} }
/**
* @return void
*/
public function form() public function form()
{ {
$productCategoryAttributes = $this->getTable()->getAllCategoryAttributesForCategoryId($this->request->getQuery('product_category_id', '-1')); $productCategoryAttributes = $this->getTable()->getAllCategoryAttributesForCategoryId($this->request->getQuery('product_category_id', '-1'));

View File

@ -113,8 +113,11 @@ class ProductCategoryAttributesTable extends Table
public function getAllCategoryAttributesForCategoryId(string $internalCategoryId) public function getAllCategoryAttributesForCategoryId(string $internalCategoryId)
{ {
$category = $this->ProductCategories->find()->where(['internal_id' => $internalCategoryId])->firstOrFail(); $category = $this->ProductCategories->find()->where(['internal_id' => $internalCategoryId])->first();
$categories = $this->ProductCategories->find('path', for: $category->id)->all(); $categories = [];
if ($category) {
$categories = $this->ProductCategories->find('path', for: $category->id)->all();
}
return $categories; return $categories;
} }