pixelant / pxa_product_manager

Product Manager. Allow to create and list products on a site. Create dynamical attributes for products. Filter by categories and attributes
11 stars 12 forks source link

[BUG] SQL Error on filter category caused by 'groupBy('tpppm.uid_local')' #404

Closed bh-teufels closed 1 year ago

bh-teufels commented 1 year ago

Describe the bug

An exception occurred while executing 'SELECT `tx_pxaproductmanager_domain_model_product`.`uid`, `tx_pxaproductmanager_domain_model_product`.`name`, `tx_pxaproductmanager_domain_model_product`.`teaser`, `tx_pxaproductmanager_domain_model_product`.`sku`, `tx_pxaproductmanager_domain_model_product`.`price`, `tx_pxaproductmanager_domain_model_product`.`singleview_page`, `tx_pxaproductmanager_domain_model_product`.`images`, `tx_pxaproductmanager_domain_model_product`.`product_type`, `tx_pxaproductmanager_domain_model_product`.`description`, `tx_pxaproductmanager_domain_model_product`.`attributes_values` FROM `tx_pxaproductmanager_domain_model_product` WHERE (`pid` IN (?)) AND (`uid` IN (SELECT `tpppm`.`uid_local` FROM `pages` INNER JOIN `tx_pxaproductmanager_product_pages_mm` `tpppm` ON `tpppm`.`uid_foreign` = `pages`.`uid` AND tpppm.tablenames = 'pages' AND tpppm.fieldname = 'doktype' WHERE (`pages`.`uid` IN (?)) AND ((`pages`.`deleted` = 0) AND (`pages`.`hidden` = 0) AND (`pages`.`starttime` <= 1680083400) AND ((`pages`.`endtime` = 0) OR (`pages`.`endtime` > 1680083400))) GROUP BY `tpppm`.`uid_local`)) AND (`uid` IN (SELECT `scrm`.`uid_foreign` FROM `sys_category` `sc` INNER JOIN `sys_category_record_mm` `scrm` ON `scrm`.`uid_local` = `sc`.`uid` WHERE (`sc`.`uid` = ?) AND (`scrm`.`tablenames` = ?) AND (`scrm`.`fieldname` = ?) AND ((`sc`.`deleted` = 0) AND (`sc`.`hidden` = 0) AND (`sc`.`starttime` <= 1680083400) AND ((`sc`.`endtime` = 0) OR (`sc`.`endtime` > 1680083400))) GROUP BY `tpppm`.`uid_local`)) AND (`sys_language_uid` IN (0, -1)) AND ((`tx_pxaproductmanager_domain_model_product`.`deleted` = 0) AND (`tx_pxaproductmanager_domain_model_product`.`hidden` = 0) AND (`tx_pxaproductmanager_domain_model_product`.`starttime` <= 1680083400) AND ((`tx_pxaproductmanager_domain_model_product`.`endtime` = 0) OR (`tx_pxaproductmanager_domain_model_product`.`endtime` > 1680083400))) ORDER BY `sku` ASC LIMIT 99' with params [88, 103, 174, "tx_pxaproductmanager_domain_model_product", "categories"]:

Unknown column 'tpppm.uid_local' in 'group statement'

removing the line [303] ->groupBy('tpppm.uid_local'); from ProductRepository.php getCategoriesSubQuery() fixes this issue but unsure how much the group statement is needed

MattiasNilsson commented 1 year ago

@bh-teufels A new release is out which addresses the issue: https://github.com/pixelant/pxa_product_manager/releases/tag/v11.0.14