{"action":"created","comment":{"url":"https://api.github.com/repos/modxcms/revolution/pulls/comments/38195365","id":38195365,"diff_hunk":"@@ -9,44 +10,39 @@\n \n class modPropertySetUpdateFromElementProcessor extends modPropertySetUpdateProcessor {\n     public $languageTopics = array('propertyset', 'category', 'element');\n-\n-    /** @var modPropertySet|null */\n-    public $object;\n-    /** @var modElement|null  */\n-    public $element = null;\n-\n-    /**\n-     * Get element, if necessary\n-     * @return null|modElement\n-     */\n-    public function getElement() {\n-        $elementId = (int)$this->getProperty('elementId', 0);\n-        $elementClass = $this->getProperty('elementType', '');\n-        if ($elementId && !empty($elementClass)) {\n-            return $this->modx->getObject($elementClass, $elementId);\n-        }\n-\n-        return null;\n-    }\n+ \n \n     /**\n      * {@inheritdoc}\n      * @return bool|null|string\n      */\n     public function initialize() {\n-        $this->element = $this->getElement();\n-\n-        $primaryKey = $this->getProperty($this->primaryKeyField, false);\n-        if ($primaryKey == 'Default') {\n-            $primaryKey = 0;\n-            $this->setProperty($this->primaryKeyField, 0);\n-        }\n-\n-        if (!$primaryKey) {\n-            if (!$this->element) return $this->modx->lexicon('element_err_ns');\n-            return true;\n+        \n+        /*\n+             Determine whether the transferred parameter set ID.\n+             If so, then the class of the current object left without changes modPropertySet\n+             If not, change the class of the class of the updated element.\n+             That is the current element $this->object as the case may be, or modPropertySet or modTemplate | modSnippet etc.\n+        */\n+        \n+        if(!$id = (int)$this->getProperty($this->primaryKeyField)){\n+            if(!$elementType = $this->getProperty('elementType')){\n+                return \"Item class has not been specified\";\n+            }\n+            \n+            // else\n+            $this->classKey = $elementType;\n+            $id = (int)$this->getProperty('elementId');\n+            \n+            // switch($this->classKey){","path":"core/model/modx/processors/element/propertyset/updatefromelement.class.php","position":64,"original_position":64,"commit_id":"bd61e77bfba648563f7bf0faeaab6efb2cc599dc","original_commit_id":"bd61e77bfba648563f7bf0faeaab6efb2cc599dc","user":{"login":"Fi1osof","id":2550668,"avatar_url":"https://avatars.githubusercontent.com/u/2550668?v=3","gravatar_id":"","url":"https://api.github.com/users/Fi1osof","html_url":"https://github.com/Fi1osof","followers_url":"https://api.github.com/users/Fi1osof/followers","following_url":"https://api.github.com/users/Fi1osof/following{/other_user}","gists_url":"https://api.github.com/users/Fi1osof/gists{/gist_id}","starred_url":"https://api.github.com/users/Fi1osof/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Fi1osof/subscriptions","organizations_url":"https://api.github.com/users/Fi1osof/orgs","repos_url":"https://api.github.com/users/Fi1osof/repos","events_url":"https://api.github.com/users/Fi1osof/events{/privacy}","received_events_url":"https://api.github.com/users/Fi1osof/received_events","type":"User","site_admin":false},"body":"This is not commented out http://joxi.ru/brRDO4pflYx021\r\nAnd the comments are needed.","created_at":"2015-08-28T12:40:30Z","updated_at":"2015-08-28T12:40:30Z","html_url":"https://github.com/modxcms/revolution/pull/12614#discussion_r38195365","pull_request_url":"https://api.github.com/repos/modxcms/revolution/pulls/12614","_links":{"self":{"href":"https://api.github.com/repos/modxcms/revolution/pulls/comments/38195365"},"html":{"href":"https://github.com/modxcms/revolution/pull/12614#discussion_r38195365"},"pull_request":{"href":"https://api.github.com/repos/modxcms/revolution/pulls/12614"}}},"pull_request":{"url":"https://api.github.com/repos/modxcms/revolution/pulls/12614","id":43599499,"html_url":"https://github.com/modxcms/revolution/pull/12614","diff_url":"https://github.com/modxcms/revolution/pull/12614.diff","patch_url":"https://github.com/modxcms/revolution/pull/12614.patch","issue_url":"https://api.github.com/repos/modxcms/revolution/issues/12614","number":12614,"state":"open","locked":false,"title":"Bugfix for #12580","user":{"login":"Fi1osof","id":2550668,"avatar_url":"https://avatars.githubusercontent.com/u/2550668?v=3","gravatar_id":"","url":"https://api.github.com/users/Fi1osof","html_url":"https://github.com/Fi1osof","followers_url":"https://api.github.com/users/Fi1osof/followers","following_url":"https://api.github.com/users/Fi1osof/following{/other_user}","gists_url":"https://api.github.com/users/Fi1osof/gists{/gist_id}","starred_url":"https://api.github.com/users/Fi1osof/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Fi1osof/subscriptions","organizations_url":"https://api.github.com/users/Fi1osof/orgs","repos_url":"https://api.github.com/users/Fi1osof/repos","events_url":"https://api.github.com/users/Fi1osof/events{/privacy}","received_events_url":"https://api.github.com/users/Fi1osof/received_events","type":"User","site_admin":false},"body":"https://github.com/modxcms/revolution/issues/12580","created_at":"2015-08-28T07:10:53Z","updated_at":"2015-08-28T12:40:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6d458f92f0196a9e14f96bc2f24e737d454dca77","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/modxcms/revolution/pulls/12614/commits","review_comments_url":"https://api.github.com/repos/modxcms/revolution/pulls/12614/comments","review_comment_url":"https://api.github.com/repos/modxcms/revolution/pulls/comments{/number}","comments_url":"https://api.github.com/repos/modxcms/revolution/issues/12614/comments","statuses_url":"https://api.github.com/repos/modxcms/revolution/statuses/bd61e77bfba648563f7bf0faeaab6efb2cc599dc","head":{"label":"Fi1osof:patch-8","ref":"patch-8","sha":"bd61e77bfba648563f7bf0faeaab6efb2cc599dc","user":{"login":"Fi1osof","id":2550668,"avatar_url":"https://avatars.githubusercontent.com/u/2550668?v=3","gravatar_id":"","url":"https://api.github.com/users/Fi1osof","html_url":"https://github.com/Fi1osof","followers_url":"https://api.github.com/users/Fi1osof/followers","following_url":"https://api.github.com/users/Fi1osof/following{/other_user}","gists_url":"https://api.github.com/users/Fi1osof/gists{/gist_id}","starred_url":"https://api.github.com/users/Fi1osof/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Fi1osof/subscriptions","organizations_url":"https://api.github.com/users/Fi1osof/orgs","repos_url":"https://api.github.com/users/Fi1osof/repos","events_url":"https://api.github.com/users/Fi1osof/events{/privacy}","received_events_url":"https://api.github.com/users/Fi1osof/received_events","type":"User","site_admin":false},"repo":{"id":29429559,"name":"revolution","full_name":"Fi1osof/revolution","owner":{"login":"Fi1osof","id":2550668,"avatar_url":"https://avatars.githubusercontent.com/u/2550668?v=3","gravatar_id":"","url":"https://api.github.com/users/Fi1osof","html_url":"https://github.com/Fi1osof","followers_url":"https://api.github.com/users/Fi1osof/followers","following_url":"https://api.github.com/users/Fi1osof/following{/other_user}","gists_url":"https://api.github.com/users/Fi1osof/gists{/gist_id}","starred_url":"https://api.github.com/users/Fi1osof/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Fi1osof/subscriptions","organizations_url":"https://api.github.com/users/Fi1osof/orgs","repos_url":"https://api.github.com/users/Fi1osof/repos","events_url":"https://api.github.com/users/Fi1osof/events{/privacy}","received_events_url":"https://api.github.com/users/Fi1osof/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Fi1osof/revolution","description":"MODx Revolution - Content Application Platform","fork":true,"url":"https://api.github.com/repos/Fi1osof/revolution","forks_url":"https://api.github.com/repos/Fi1osof/revolution/forks","keys_url":"https://api.github.com/repos/Fi1osof/revolution/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Fi1osof/revolution/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Fi1osof/revolution/teams","hooks_url":"https://api.github.com/repos/Fi1osof/revolution/hooks","issue_events_url":"https://api.github.com/repos/Fi1osof/revolution/issues/events{/number}","events_url":"https://api.github.com/repos/Fi1osof/revolution/events","assignees_url":"https://api.github.com/repos/Fi1osof/revolution/assignees{/user}","branches_url":"https://api.github.com/repos/Fi1osof/revolution/branches{/branch}","tags_url":"https://api.github.com/repos/Fi1osof/revolution/tags","blobs_url":"https://api.github.com/repos/Fi1osof/revolution/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Fi1osof/revolution/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Fi1osof/revolution/git/refs{/sha}","trees_url":"https://api.github.com/repos/Fi1osof/revolution/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Fi1osof/revolution/statuses/{sha}","languages_url":"https://api.github.com/repos/Fi1osof/revolution/languages","stargazers_url":"https://api.github.com/repos/Fi1osof/revolution/stargazers","contributors_url":"https://api.github.com/repos/Fi1osof/revolution/contributors","subscribers_url":"https://api.github.com/repos/Fi1osof/revolution/subscribers","subscription_url":"https://api.github.com/repos/Fi1osof/revolution/subscription","commits_url":"https://api.github.com/repos/Fi1osof/revolution/commits{/sha}","git_commits_url":"https://api.github.com/repos/Fi1osof/revolution/git/commits{/sha}","comments_url":"https://api.github.com/repos/Fi1osof/revolution/comments{/number}","issue_comment_url":"https://api.github.com/repos/Fi1osof/revolution/issues/comments{/number}","contents_url":"https://api.github.com/repos/Fi1osof/revolution/contents/{+path}","compare_url":"https://api.github.com/repos/Fi1osof/revolution/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Fi1osof/revolution/merges","archive_url":"https://api.github.com/repos/Fi1osof/revolution/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Fi1osof/revolution/downloads","issues_url":"https://api.github.com/repos/Fi1osof/revolution/issues{/number}","pulls_url":"https://api.github.com/repos/Fi1osof/revolution/pulls{/number}","milestones_url":"https://api.github.com/repos/Fi1osof/revolution/milestones{/number}","notifications_url":"https://api.github.com/repos/Fi1osof/revolution/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Fi1osof/revolution/labels{/name}","releases_url":"https://api.github.com/repos/Fi1osof/revolution/releases{/id}","created_at":"2015-01-18T15:04:16Z","updated_at":"2015-01-18T15:04:24Z","pushed_at":"2015-08-28T07:10:39Z","git_url":"git://github.com/Fi1osof/revolution.git","ssh_url":"git@github.com:Fi1osof/revolution.git","clone_url":"https://github.com/Fi1osof/revolution.git","svn_url":"https://github.com/Fi1osof/revolution","homepage":"http://rtfm.modx.com/revolution/2.x/","size":43536,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"modxcms:master","ref":"master","sha":"3ebd6b57c1165723fc5ca81d7e19f1ae8056366c","user":{"login":"modxcms","id":232723,"avatar_url":"https://avatars.githubusercontent.com/u/232723?v=3","gravatar_id":"","url":"https://api.github.com/users/modxcms","html_url":"https://github.com/modxcms","followers_url":"https://api.github.com/users/modxcms/followers","following_url":"https://api.github.com/users/modxcms/following{/other_user}","gists_url":"https://api.github.com/users/modxcms/gists{/gist_id}","starred_url":"https://api.github.com/users/modxcms/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/modxcms/subscriptions","organizations_url":"https://api.github.com/users/modxcms/orgs","repos_url":"https://api.github.com/users/modxcms/repos","events_url":"https://api.github.com/users/modxcms/events{/privacy}","received_events_url":"https://api.github.com/users/modxcms/received_events","type":"Organization","site_admin":false},"repo":{"id":806201,"name":"revolution","full_name":"modxcms/revolution","owner":{"login":"modxcms","id":232723,"avatar_url":"https://avatars.githubusercontent.com/u/232723?v=3","gravatar_id":"","url":"https://api.github.com/users/modxcms","html_url":"https://github.com/modxcms","followers_url":"https://api.github.com/users/modxcms/followers","following_url":"https://api.github.com/users/modxcms/following{/other_user}","gists_url":"https://api.github.com/users/modxcms/gists{/gist_id}","starred_url":"https://api.github.com/users/modxcms/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/modxcms/subscriptions","organizations_url":"https://api.github.com/users/modxcms/orgs","repos_url":"https://api.github.com/users/modxcms/repos","events_url":"https://api.github.com/users/modxcms/events{/privacy}","received_events_url":"https://api.github.com/users/modxcms/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/modxcms/revolution","description":"MODX Revolution - Content Application Platform","fork":false,"url":"https://api.github.com/repos/modxcms/revolution","forks_url":"https://api.github.com/repos/modxcms/revolution/forks","keys_url":"https://api.github.com/repos/modxcms/revolution/keys{/key_id}","collaborators_url":"https://api.github.com/repos/modxcms/revolution/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/modxcms/revolution/teams","hooks_url":"https://api.github.com/repos/modxcms/revolution/hooks","issue_events_url":"https://api.github.com/repos/modxcms/revolution/issues/events{/number}","events_url":"https://api.github.com/repos/modxcms/revolution/events","assignees_url":"https://api.github.com/repos/modxcms/revolution/assignees{/user}","branches_url":"https://api.github.com/repos/modxcms/revolution/branches{/branch}","tags_url":"https://api.github.com/repos/modxcms/revolution/tags","blobs_url":"https://api.github.com/repos/modxcms/revolution/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/modxcms/revolution/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/modxcms/revolution/git/refs{/sha}","trees_url":"https://api.github.com/repos/modxcms/revolution/git/trees{/sha}","statuses_url":"https://api.github.com/repos/modxcms/revolution/statuses/{sha}","languages_url":"https://api.github.com/repos/modxcms/revolution/languages","stargazers_url":"https://api.github.com/repos/modxcms/revolution/stargazers","contributors_url":"https://api.github.com/repos/modxcms/revolution/contributors","subscribers_url":"https://api.github.com/repos/modxcms/revolution/subscribers","subscription_url":"https://api.github.com/repos/modxcms/revolution/subscription","commits_url":"https://api.github.com/repos/modxcms/revolution/commits{/sha}","git_commits_url":"https://api.github.com/repos/modxcms/revolution/git/commits{/sha}","comments_url":"https://api.github.com/repos/modxcms/revolution/comments{/number}","issue_comment_url":"https://api.github.com/repos/modxcms/revolution/issues/comments{/number}","contents_url":"https://api.github.com/repos/modxcms/revolution/contents/{+path}","compare_url":"https://api.github.com/repos/modxcms/revolution/compare/{base}...{head}","merges_url":"https://api.github.com/repos/modxcms/revolution/merges","archive_url":"https://api.github.com/repos/modxcms/revolution/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/modxcms/revolution/downloads","issues_url":"https://api.github.com/repos/modxcms/revolution/issues{/number}","pulls_url":"https://api.github.com/repos/modxcms/revolution/pulls{/number}","milestones_url":"https://api.github.com/repos/modxcms/revolution/milestones{/number}","notifications_url":"https://api.github.com/repos/modxcms/revolution/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/modxcms/revolution/labels{/name}","releases_url":"https://api.github.com/repos/modxcms/revolution/releases{/id}","created_at":"2010-07-29T21:03:57Z","updated_at":"2015-08-25T23:02:11Z","pushed_at":"2015-08-28T12:39:12Z","git_url":"git://github.com/modxcms/revolution.git","ssh_url":"git@github.com:modxcms/revolution.git","clone_url":"https://github.com/modxcms/revolution.git","svn_url":"https://github.com/modxcms/revolution","homepage":"http://rtfm.modx.com/revolution/2.x/","size":82157,"stargazers_count":694,"watchers_count":694,"language":"PHP","has_issues":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":357,"mirror_url":null,"open_issues_count":931,"forks":357,"open_issues":931,"watchers":694,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/modxcms/revolution/pulls/12614"},"html":{"href":"https://github.com/modxcms/revolution/pull/12614"},"issue":{"href":"https://api.github.com/repos/modxcms/revolution/issues/12614"},"comments":{"href":"https://api.github.com/repos/modxcms/revolution/issues/12614/comments"},"review_comments":{"href":"https://api.github.com/repos/modxcms/revolution/pulls/12614/comments"},"review_comment":{"href":"https://api.github.com/repos/modxcms/revolution/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/modxcms/revolution/pulls/12614/commits"},"statuses":{"href":"https://api.github.com/repos/modxcms/revolution/statuses/bd61e77bfba648563f7bf0faeaab6efb2cc599dc"}}}}