{"action":"closed","issue":{"url":"https://api.github.com/repos/Flagbit/Magento-FACTFinder/issues/199","repository_url":"https://api.github.com/repos/Flagbit/Magento-FACTFinder","labels_url":"https://api.github.com/repos/Flagbit/Magento-FACTFinder/issues/199/labels{/name}","comments_url":"https://api.github.com/repos/Flagbit/Magento-FACTFinder/issues/199/comments","events_url":"https://api.github.com/repos/Flagbit/Magento-FACTFinder/issues/199/events","html_url":"https://github.com/Flagbit/Magento-FACTFinder/issues/199","id":219539171,"number":199,"title":"Export problem for searchable attributes in v4.1.13","user":{"login":"homecoded","id":565020,"avatar_url":"https://avatars1.githubusercontent.com/u/565020?v=3","gravatar_id":"","url":"https://api.github.com/users/homecoded","html_url":"https://github.com/homecoded","followers_url":"https://api.github.com/users/homecoded/followers","following_url":"https://api.github.com/users/homecoded/following{/other_user}","gists_url":"https://api.github.com/users/homecoded/gists{/gist_id}","starred_url":"https://api.github.com/users/homecoded/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/homecoded/subscriptions","organizations_url":"https://api.github.com/users/homecoded/orgs","repos_url":"https://api.github.com/users/homecoded/repos","events_url":"https://api.github.com/users/homecoded/events{/privacy}","received_events_url":"https://api.github.com/users/homecoded/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2017-04-05T10:36:31Z","updated_at":"2017-04-28T14:20:04Z","closed_at":"2017-04-28T14:20:04Z","body":"- Extension-Version: v4.1.13\r\n- Magento edition and version: 1.14.3.2 EE\r\n- PHP version: 5.6.30\r\n- Expected behavior: \r\n\r\nCSV-Export contains the same attributes as in version v4.1.12\r\n\r\n- Actual behavior: \r\n\r\nCSV-Export is missing searchable attributes\r\n\r\n- Steps to reproduce: \r\n\r\nI made an CSV-export with version v4.1.12. Then, I upgraded the Magento-FACTFinder extension and compared the results. I saw that all user-defined searchable attributes were missing from the ```searchable_attributes``` column in the CSV. So, I browsed through the code and in ```app/code/community/FACTFinder/Core/Model/Export/Type/Product/Attribute.php``` I found the method ```_isAttributeSearchable```, which may be be faulty:\r\n\r\n```\r\n    protected function _isAttributeSearchable($attribute, $storeId)\r\n    {\r\n        if ($this->_isAttributeNumerical($attribute, $storeId)) {\r\n            return false;\r\n        }\r\n\r\n        if (!$attribute->getIsUserDefined()\r\n            || !$attribute->getIsSearchable()\r\n            || in_array($attribute->getAttributeCode(), $this->getExportAttributes($storeId))\r\n        ) {\r\n            return true;\r\n        }\r\n\r\n        return false;\r\n    }\r\n```\r\nBecause of the ```!$attribute->getIsSearchable()```expression, the method will not return true for user-defined attributes even if they are searchable. In our code, I went ahead an overrode ```FACTFinder_Core_Model_Export_Type_Product_Attribute``` and replaced the ```_isAttributeSearchable``` method with a version where the ```!``` is missing in front of ```$attribute->getIsSearchable()```. Then, the export produced exactly the same results as in version v4.1.12.\r\n\r\nIf indeed you agree that is is a mistake, I am happy to propose a PR."}}
{"actor":{"display_login":"homecoded"}}