magento2-blog-module-tutorial
magento2-blog-module-tutorial copied to clipboard
Error on mass delete/disable single item
Exception #0 (Zend_Db_Statement_Exception): SQLSTATE[42S22]: Column not found: 1054 Unknown column 'block_id' in 'where clause', query was: SELECT main_table
.* FROM ashsmith_blog_post
AS main_table
WHERE (block_id
IN('9'))
Probably in
<dataSource name="blog_post_listing_data_source">
<argument name="dataProvider" xsi:type="configurableObject">
<argument name="class" xsi:type="string">PostGridDataProvider</argument>
<argument name="name" xsi:type="string">blog_post_listing_data_source</argument>
<argument name="primaryFieldName" xsi:type="string">block_id</argument>
<argument name="requestFieldName" xsi:type="string">id</argument>
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="update_url" xsi:type="url" path="mui/index/render"/>
</item>
</argument>
</argument>
<argument name="data" xsi:type="array">
<item name="js_config" xsi:type="array">
<item name="component" xsi:type="string">Magento_Ui/js/grid/provider</item>
</item>
</argument>
</dataSource>
Yes, It has fixed the issue. In below file.
adminhtml/ui_component/blog_post_listing.xml
replace block_id with post_id and it works.
Read this https://magento.stackexchange.com/questions/109835/unknown-columns-error-when-executing-a-mass-action