We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
EAV Collections expect columns to be declared as attributes. Joined columns are not available as attributes.
More information can be found in #55.
Test to reproduce the issue:
/** * @magentoDataFixture Magento/Catalog/_files/product_simple.php * @magentoDataFixture Magento/Catalog/_files/products_list.php */ public function testFilterJoinedAttributeOnEavCollection(): void { $processor = new class() extends AbstractGridSourceProcessor implements HyvaGridCollectionProcessorInterface { /** * @param ProductCollection $source * @param string $gridName */ public function afterInitSelect(AbstractDbCollection $source, string $gridName): void { $source->joinField( 'test_field', 'catalog_category_product', 'product_id', 'e.entity_id = test_field' ); } }; $args = [ 'gridName' => 'test', 'processors' => [$processor], 'sourceConfiguration' => ['collection' => ProductCollection::class], ]; /** @var CollectionGridSourceType $sut */ $sut = ObjectManager::getInstance()->create(CollectionGridSourceType::class, $args); /** @var SearchCriteriaBuilder $searchCriteriaBuilder */ $searchCriteriaBuilder = ObjectManager::getInstance()->get(SearchCriteriaBuilder::class); $searchCriteriaBuilder->addFilter('test_field', '1'); $rawGridData = $sut->fetchData($searchCriteriaBuilder->create()); $records = $sut->extractRecords($rawGridData); $this->assertGreaterThan(0, count($records)); }
The text was updated successfully, but these errors were encountered:
I came across this issue yesterday whilst implementing a grid using a custom Grid Collection.
I was able to work around this issue by adding fake method docBlocks to the Model class for the joined fields and/or custom fields e.g.
/** * @method ?string getProductSku() * @method ?string getProductName() * @method ?string getCustomerGroupCode() * @method ?\Vendor\TradeAccounts\Model\StoreTierPriceValue getValueObject() */
This isn't really ideal as the model doesn't really have these functions and will only work if you control the Model Source code
Sorry, something went wrong.
No branches or pull requests
EAV Collections expect columns to be declared as attributes. Joined columns are not available as attributes.
More information can be found in #55.
Test to reproduce the issue:
The text was updated successfully, but these errors were encountered: