Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Application breaks when \Magento\Catalog\Model\ResourceModel\Category\Flat::getCategories is called, with $toLoad == false (so collection is not loaded yet, as it is called indirectly at magento/module-catalog-event/Block/Event/Lister.php:108: $categories = $this->_categoryHelper->getStoreCategories('position', true, false);), then \Magento\Catalog\Model\ResourceModel\Category\Flat\Collection::addIdFilter is called for the unloaded collection (as in magento/module-catalog-event/Block/Event/Lister.php:125: $categories->addIdFilter($eventCollection->getColumnValues('category_id'));), and then it tries to load the collection.
It breaks due to ambiguous 'entity_id' field in where clause; field with such name is both found within catalog_category_flat_store_% and url_rewrite tables.
Manual testing scenarios
Issues related
#7523