{"action":"opened","issue":{"url":"https://api.github.com/repos/dweeves/magmi-git/issues/237","labels_url":"https://api.github.com/repos/dweeves/magmi-git/issues/237/labels{/name}","comments_url":"https://api.github.com/repos/dweeves/magmi-git/issues/237/comments","events_url":"https://api.github.com/repos/dweeves/magmi-git/issues/237/events","html_url":"https://github.com/dweeves/magmi-git/issues/237","id":68906291,"number":237,"title":"Unsetting the option of a select attribute is not possible in mode 'create'","user":{"login":"ckressibucher","id":3111098,"avatar_url":"https://avatars.githubusercontent.com/u/3111098?v=3","gravatar_id":"","url":"https://api.github.com/users/ckressibucher","html_url":"https://github.com/ckressibucher","followers_url":"https://api.github.com/users/ckressibucher/followers","following_url":"https://api.github.com/users/ckressibucher/following{/other_user}","gists_url":"https://api.github.com/users/ckressibucher/gists{/gist_id}","starred_url":"https://api.github.com/users/ckressibucher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ckressibucher/subscriptions","organizations_url":"https://api.github.com/users/ckressibucher/orgs","repos_url":"https://api.github.com/users/ckressibucher/repos","events_url":"https://api.github.com/users/ckressibucher/events{/privacy}","received_events_url":"https://api.github.com/users/ckressibucher/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-04-16T11:42:31Z","updated_at":"2015-04-16T11:42:31Z","closed_at":null,"body":"`create` mode is describe as \"create new items &amp; update existing ones\". So it should be possible to set the default attribute option (\"unset\" the selected option) of a select attribute. Unfortunately, I did not find a way to do it:\r\n\r\nFirst tried \"__MAGMI_DELETE__\". Problem: Instead of deleteing the row from the catalog_product_entity_int table (this would be what I expect), it creates a new option with the literal value \"__MAGMI_DELETE_\". This happens because the \"handleIntAttribute\" method of the default attribute handler does not handel any 'magic values', but treat it as a normal value.\r\n\r\nSecond try: Setting the value to an empty string. (because this causes the `handleIntAttribute` method to return '__MAGMI_DELETE__', in which case the import engine would delete the rows). No luck here as well, as emtpy options are skipped if the mode is not \"update\".\r\n\r\nIn my opinion, this is a bug. My suggestion would be to modify the line\r\n`if ($ivalue == \"\" && $this->mode != \"update\" && $tp == \"int\")` to `if ($ivalue == \"\" && $this->mode == \"xcreate\" && $tp == \"int\")` in the import engine.\r\n(https://github.com/dweeves/magmi-git/blob/master/magmi/engines/magmi_productimportengine.php#L1020)\r\n\r\nAnother fix would be to somehow prevent inserting magic values as an attribute option in general. But this may have too many side effects, so I would suggest the fix in the product import engine.\r\n\r\n"}}