1

After deleting a store my cms and static block pages have become unviewable under admin. Instead I'm left with the error below. I tried to reindex and delete any cache files I could find even though I'm sure this is a db problem. Just not sure how to approach it, any help would be appreciated.

Notice: Undefined index: store_id in /var/www/html/magento2/vendor/magento/module-store/Ui/Component/Listing/Column/Store.php on line 82

2

There is a table that match cms_pages and stores (cms_page_store), to find any relation error you can make a Left Join to determine if some page isn't assigned to any store:

SELECT cp.page_id, cp.identifier, cps.store_id FROM cms_page AS cp
LEFT JOIN cms_page_store as cps on cps.page_id = cp.page_id

If you see some page without store like here:

enter image description here

Just add a new record to cms_page_store for that/those page/s. with value = 0 (admin)

  • Thank you. I had to add values to cms_page_store and cms_block_store as they were both null. Any idea what caused this? – themanwhoknowstheman Feb 8 '16 at 5:52
  • Yes, the store deletion, seems to be a problem for magento (since V1) the store deletion collateral tasks, when you remove a store, store-specific tables as catalog_flat_{store_id} and catalogsearch_fultext_scope{store_id} still existing in the database. I think that is basically a bug. – MauroNigrele Feb 8 '16 at 5:58
2

Adding to the answer from @MauroNigrele : If your problem is with a block instead of a page, run this query:

SELECT cp.block_id, cp.identifier, cps.store_id FROM cms_block AS cp LEFT JOIN cms_block_store as cps on cps.block_id = cp.block_id;

If you notice that the block with block_id = 3 has NULL for store_id, your insert query should look like this:

INSERT INTO cms_block_store (block_id, store_id) VALUES (3,0);

This should fix any errors caused by this.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.