mirasvit / module-blog

Magento 2 Blog Extension
https://mirasvit.com/magento-2-extensions/blog.html
Open Software License 3.0
67 stars 48 forks source link

Fixing bug in admin panel #70

Closed JosephMaxwell closed 7 years ago

JosephMaxwell commented 7 years ago

A build that we are using this for (BTW, thank you for making this available—it's a great module) noticed that when they tried to filter blog posts by a category, they would get an error.

Digging into this, Magento was giving this error: "category_ids" is not a valid attribute. The reason for this is that the search result is applied to the DataProvider before category_ids is injected (\Mirasvit\Blog\Ui\Component\DataProvider, line 82). The solution isn't the cleanest, but I am not sure if there is a better way to get this done. Essentially, if the category_ids filter is requested, we intercept that and join in the category / post linking table.