{"action":"created","issue":{"url":"https://api.github.com/repos/silverstripe/silverstripe-framework/issues/8613","repository_url":"https://api.github.com/repos/silverstripe/silverstripe-framework","labels_url":"https://api.github.com/repos/silverstripe/silverstripe-framework/issues/8613/labels{/name}","comments_url":"https://api.github.com/repos/silverstripe/silverstripe-framework/issues/8613/comments","events_url":"https://api.github.com/repos/silverstripe/silverstripe-framework/issues/8613/events","html_url":"https://github.com/silverstripe/silverstripe-framework/issues/8613","id":381600126,"node_id":"MDU6SXNzdWUzODE2MDAxMjY=","number":8613,"title":"Extensions behave inconsistent","user":{"login":"jkondela","id":4798782,"node_id":"MDQ6VXNlcjQ3OTg3ODI=","avatar_url":"https://avatars1.githubusercontent.com/u/4798782?v=4","gravatar_id":"","url":"https://api.github.com/users/jkondela","html_url":"https://github.com/jkondela","followers_url":"https://api.github.com/users/jkondela/followers","following_url":"https://api.github.com/users/jkondela/following{/other_user}","gists_url":"https://api.github.com/users/jkondela/gists{/gist_id}","starred_url":"https://api.github.com/users/jkondela/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jkondela/subscriptions","organizations_url":"https://api.github.com/users/jkondela/orgs","repos_url":"https://api.github.com/users/jkondela/repos","events_url":"https://api.github.com/users/jkondela/events{/privacy}","received_events_url":"https://api.github.com/users/jkondela/received_events","type":"User","site_admin":false},"labels":[{"id":386316041,"node_id":"MDU6TGFiZWwzODYzMTYwNDE=","url":"https://api.github.com/repos/silverstripe/silverstripe-framework/labels/affects/v4","name":"affects/v4","color":"5319e7","default":false},{"id":86042187,"node_id":"MDU6TGFiZWw4NjA0MjE4Nw==","url":"https://api.github.com/repos/silverstripe/silverstripe-framework/labels/change/patch","name":"change/patch","color":"fef2c0","default":false},{"id":182941393,"node_id":"MDU6TGFiZWwxODI5NDEzOTM=","url":"https://api.github.com/repos/silverstripe/silverstripe-framework/labels/effort/medium","name":"effort/medium","color":"fef2c0","default":false},{"id":182941354,"node_id":"MDU6TGFiZWwxODI5NDEzNTQ=","url":"https://api.github.com/repos/silverstripe/silverstripe-framework/labels/impact/high","name":"impact/high","color":"eb6420","default":false},{"id":421035839,"node_id":"MDU6TGFiZWw0MjEwMzU4Mzk=","url":"https://api.github.com/repos/silverstripe/silverstripe-framework/labels/type/bug","name":"type/bug","color":"d93f0b","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2018-11-16T13:29:44Z","updated_at":"2018-11-21T00:10:09Z","closed_at":null,"author_association":"NONE","body":"## Affected Version\r\nTested on current 4.2.2\r\n\r\n## Description\r\n\r\nExtensions behave weird and inconsistent. \r\n\r\nAfter removing extension by calling `remove_extension`, it will not preserve inherited extensions.\r\nAffected method is `get_extensions` which returns before calling `remove_extension` all extensions (including inherited), but after removing single extension, it will probably save wrong configuration. The result is only extensions on called class.\r\n\r\nI was able to discover this issue by getting error in CMS. Error was that Hierarchy extension is not added to Page. There was also [opened issue](https://github.com/silverstripe/silverstripe-cms/issues/2117) in CMS repo, but it cannot be reproduced due to not calling `remove_extension`.\r\n\r\nA picture is worth a thousand words:\r\n\r\n![screenshot_20](https://user-images.githubusercontent.com/4798782/48623318-9eeee000-e9a9-11e8-8bc4-063b9b4716cc.png)\r\n\r\n## Steps to Reproduce\r\n\r\nFor instance try to add extension on Page class (which extends SiteTree) and then remove_extension.\r\n"},"comment":{"url":"https://api.github.com/repos/silverstripe/silverstripe-framework/issues/comments/440476657","html_url":"https://github.com/silverstripe/silverstripe-framework/issues/8613#issuecomment-440476657","issue_url":"https://api.github.com/repos/silverstripe/silverstripe-framework/issues/8613","id":440476657,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0MDQ3NjY1Nw==","user":{"login":"tractorcow","id":936064,"node_id":"MDQ6VXNlcjkzNjA2NA==","avatar_url":"https://avatars2.githubusercontent.com/u/936064?v=4","gravatar_id":"","url":"https://api.github.com/users/tractorcow","html_url":"https://github.com/tractorcow","followers_url":"https://api.github.com/users/tractorcow/followers","following_url":"https://api.github.com/users/tractorcow/following{/other_user}","gists_url":"https://api.github.com/users/tractorcow/gists{/gist_id}","starred_url":"https://api.github.com/users/tractorcow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tractorcow/subscriptions","organizations_url":"https://api.github.com/users/tractorcow/orgs","repos_url":"https://api.github.com/users/tractorcow/repos","events_url":"https://api.github.com/users/tractorcow/events{/privacy}","received_events_url":"https://api.github.com/users/tractorcow/received_events","type":"User","site_admin":false},"created_at":"2018-11-21T00:10:09Z","updated_at":"2018-11-21T00:10:09Z","author_association":"CONTRIBUTOR","body":"You could extend has_extension(). We already have $strict to toggle between matching subclasses of the extension. You could augment this arg to be a set of flags that also allow matching of extensions on the parent of the class being checked. Or, well, just add another arg. ;P\r\n\r\nIn any case, the problem isn't with has_extension(), but rather with remove_extension(). I'm not sure that has_extension() being true automatically implies that the extension can be removed, so I wouldn't assume it's a direct relationship."}}
{"actor":{"display_login":"tractorcow"}}