I have this line of code in my site:
$collectionids=Mage::getModel('catalog/category')->getCollection()->addAttributeToFilter('someAttribute', $valueToLookFor)->addAttributeToFilter('anotherAttribute', "constant")->getAllIds();
With Flat Category turned off the correct category ids are stored in $collectionids. When it is turned on nothing is returned (verified using xdebug). The attributes are custom attributes and I have verified they exist in the “catalog_category_flat_store_*” tables. Other categories are selected fine, as long as they do not use a filter. Thanks in advance for any help.
EDIT: I did some more deep debugging and it looks like the magento core is only checking the catalog_category_flat_store_1 table, and not the other 11 that exist. This is the query being used:
SELECT `main_table`.`entity_id` FROM `catalog_category_flat_store_1` AS `main_table` WHERE (someAttribute = 'valueToLookFor') AND (anotherAttribute = 'constant')
Is this a Magento core bug, or am I missing something?