{"action":"created","comment":{"url":"https://api.github.com/repos/OTRS/otrs/pulls/comments/24232454","id":24232454,"diff_hunk":"@@ -29,28 +24,20 @@ sub new {\n     my $Self = {%Param};\n     bless( $Self, $Type );\n \n-    # check needed objects\n-    for my $Needed (qw(ParamObject DBObject LayoutObject LogObject ConfigObject MainObject)) {\n-        if ( !$Self->{$Needed} ) {\n-            $Self->{LayoutObject}->FatalError( Message => \"Got no $Needed!\" );\n-        }\n-    }\n-\n-    $Self->{PackageObject}     = Kernel::System::Package->new(%Param);\n-    $Self->{UploadCacheObject} = Kernel::System::Web::UploadCache->new(%Param);\n-    $Self->{CacheObject}       = $Kernel::OM->Get('Kernel::System::Cache');\n-    $Self->{SystemDataObject}  = Kernel::System::SystemData->new(%Param);\n-    $Self->{RegistrationState} = $Self->{SystemDataObject}->SystemDataGet(\n-        Key => 'Registration::State',\n-    ) || '';\n-    $Self->{CloudServiceObject} = Kernel::System::CloudService->new(%Param);\n-\n     return $Self;\n }\n \n sub Run {\n     my ( $Self, %Param ) = @_;\n \n+    my $PackageObject     = $Kernel::OM->Get('Kernel::System::Package');\n+    my $LayoutObject      = $Kernel::OM->Get('Kernel::Output::HTML::Layout');\n+    my $ParamObject       = $Kernel::OM->Get('Kernel::System::Web::Request');\n+    my $DBObject          = $Kernel::OM->Get('Kernel::System::DB');\n+    my $MainObject        = $Kernel::OM->Get('Kernel::System::Main');\n+    my $ConfigObject      = $Kernel::OM->Get('Kernel::Config');\n+    my $UploadCacheObject = $Kernel::OM->Get('Kernel::System::Web::UploadCache');\n+","path":"Kernel/Modules/AdminPackageManager.pm","position":45,"original_position":45,"commit_id":"494e4e8397c0c469ce4e21770f7eee5bb43b6a20","original_commit_id":"494e4e8397c0c469ce4e21770f7eee5bb43b6a20","user":{"login":"mrcbnsls","id":4690172,"avatar_url":"https://avatars.githubusercontent.com/u/4690172?v=3","gravatar_id":"","url":"https://api.github.com/users/mrcbnsls","html_url":"https://github.com/mrcbnsls","followers_url":"https://api.github.com/users/mrcbnsls/followers","following_url":"https://api.github.com/users/mrcbnsls/following{/other_user}","gists_url":"https://api.github.com/users/mrcbnsls/gists{/gist_id}","starred_url":"https://api.github.com/users/mrcbnsls/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrcbnsls/subscriptions","organizations_url":"https://api.github.com/users/mrcbnsls/orgs","repos_url":"https://api.github.com/users/mrcbnsls/repos","events_url":"https://api.github.com/users/mrcbnsls/events{/privacy}","received_events_url":"https://api.github.com/users/mrcbnsls/received_events","type":"User","site_admin":false},"body":"Objects should be pulled from the OM just before they are actually needed. There are returns in the code (e.g. line#62 or line#77) before some of these objects you created here are used. Please go through the code again and create objects later if possible.\r\n\r\nExample: The ParamObject ist used first in line#84, so it should be pulled from OM in line#78 (before if ( $Self->{Subaction} eq 'ViewDiff' )).\r\n\r\nPlease let me know if you have more questions about this.","created_at":"2015-02-06T10:22:25Z","updated_at":"2015-02-06T10:22:25Z","html_url":"https://github.com/OTRS/otrs/pull/430#discussion_r24232454","pull_request_url":"https://api.github.com/repos/OTRS/otrs/pulls/430","_links":{"self":{"href":"https://api.github.com/repos/OTRS/otrs/pulls/comments/24232454"},"html":{"href":"https://github.com/OTRS/otrs/pull/430#discussion_r24232454"},"pull_request":{"href":"https://api.github.com/repos/OTRS/otrs/pulls/430"}}},"pull_request":{"url":"https://api.github.com/repos/OTRS/otrs/pulls/430","id":28242760,"html_url":"https://github.com/OTRS/otrs/pull/430","diff_url":"https://github.com/OTRS/otrs/pull/430.diff","patch_url":"https://github.com/OTRS/otrs/pull/430.patch","issue_url":"https://api.github.com/repos/OTRS/otrs/issues/430","number":430,"state":"open","locked":false,"title":"Selenium test package manager","user":{"login":"s7design","id":6348760,"avatar_url":"https://avatars.githubusercontent.com/u/6348760?v=3","gravatar_id":"","url":"https://api.github.com/users/s7design","html_url":"https://github.com/s7design","followers_url":"https://api.github.com/users/s7design/followers","following_url":"https://api.github.com/users/s7design/following{/other_user}","gists_url":"https://api.github.com/users/s7design/gists{/gist_id}","starred_url":"https://api.github.com/users/s7design/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/s7design/subscriptions","organizations_url":"https://api.github.com/users/s7design/orgs","repos_url":"https://api.github.com/users/s7design/repos","events_url":"https://api.github.com/users/s7design/events{/privacy}","received_events_url":"https://api.github.com/users/s7design/received_events","type":"User","site_admin":false},"body":"Hi @mrcbnsls,\r\n\r\nThere is a selenium test and porting to OM for PackageManager.\r\nI added TestPackage.opm file in test/sample folder. I used it for Selenium testing. I hope that it is OK.\r\n\r\nI can use String value in format like xml file, or temporarily local file in AdminPackageMenager.t, but with added test package module I am able to test installing package from file that is selected from file system.\r\n\r\nRegards\r\nZoran","created_at":"2015-01-29T00:15:16Z","updated_at":"2015-02-06T10:22:25Z","closed_at":null,"merged_at":null,"merge_commit_sha":"084c2fe2a98752b38e25f33001d5d1f86da16574","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/OTRS/otrs/pulls/430/commits","review_comments_url":"https://api.github.com/repos/OTRS/otrs/pulls/430/comments","review_comment_url":"https://api.github.com/repos/OTRS/otrs/pulls/comments/{number}","comments_url":"https://api.github.com/repos/OTRS/otrs/issues/430/comments","statuses_url":"https://api.github.com/repos/OTRS/otrs/statuses/494e4e8397c0c469ce4e21770f7eee5bb43b6a20","head":{"label":"s7design:selenium_test_PackageManager","ref":"selenium_test_PackageManager","sha":"494e4e8397c0c469ce4e21770f7eee5bb43b6a20","user":{"login":"s7design","id":6348760,"avatar_url":"https://avatars.githubusercontent.com/u/6348760?v=3","gravatar_id":"","url":"https://api.github.com/users/s7design","html_url":"https://github.com/s7design","followers_url":"https://api.github.com/users/s7design/followers","following_url":"https://api.github.com/users/s7design/following{/other_user}","gists_url":"https://api.github.com/users/s7design/gists{/gist_id}","starred_url":"https://api.github.com/users/s7design/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/s7design/subscriptions","organizations_url":"https://api.github.com/users/s7design/orgs","repos_url":"https://api.github.com/users/s7design/repos","events_url":"https://api.github.com/users/s7design/events{/privacy}","received_events_url":"https://api.github.com/users/s7design/received_events","type":"User","site_admin":false},"repo":{"id":16277254,"name":"otrs","full_name":"s7design/otrs","owner":{"login":"s7design","id":6348760,"avatar_url":"https://avatars.githubusercontent.com/u/6348760?v=3","gravatar_id":"","url":"https://api.github.com/users/s7design","html_url":"https://github.com/s7design","followers_url":"https://api.github.com/users/s7design/followers","following_url":"https://api.github.com/users/s7design/following{/other_user}","gists_url":"https://api.github.com/users/s7design/gists{/gist_id}","starred_url":"https://api.github.com/users/s7design/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/s7design/subscriptions","organizations_url":"https://api.github.com/users/s7design/orgs","repos_url":"https://api.github.com/users/s7design/repos","events_url":"https://api.github.com/users/s7design/events{/privacy}","received_events_url":"https://api.github.com/users/s7design/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/s7design/otrs","description":"The OTRS framework.","fork":true,"url":"https://api.github.com/repos/s7design/otrs","forks_url":"https://api.github.com/repos/s7design/otrs/forks","keys_url":"https://api.github.com/repos/s7design/otrs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/s7design/otrs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/s7design/otrs/teams","hooks_url":"https://api.github.com/repos/s7design/otrs/hooks","issue_events_url":"https://api.github.com/repos/s7design/otrs/issues/events{/number}","events_url":"https://api.github.com/repos/s7design/otrs/events","assignees_url":"https://api.github.com/repos/s7design/otrs/assignees{/user}","branches_url":"https://api.github.com/repos/s7design/otrs/branches{/branch}","tags_url":"https://api.github.com/repos/s7design/otrs/tags","blobs_url":"https://api.github.com/repos/s7design/otrs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/s7design/otrs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/s7design/otrs/git/refs{/sha}","trees_url":"https://api.github.com/repos/s7design/otrs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/s7design/otrs/statuses/{sha}","languages_url":"https://api.github.com/repos/s7design/otrs/languages","stargazers_url":"https://api.github.com/repos/s7design/otrs/stargazers","contributors_url":"https://api.github.com/repos/s7design/otrs/contributors","subscribers_url":"https://api.github.com/repos/s7design/otrs/subscribers","subscription_url":"https://api.github.com/repos/s7design/otrs/subscription","commits_url":"https://api.github.com/repos/s7design/otrs/commits{/sha}","git_commits_url":"https://api.github.com/repos/s7design/otrs/git/commits{/sha}","comments_url":"https://api.github.com/repos/s7design/otrs/comments{/number}","issue_comment_url":"https://api.github.com/repos/s7design/otrs/issues/comments/{number}","contents_url":"https://api.github.com/repos/s7design/otrs/contents/{+path}","compare_url":"https://api.github.com/repos/s7design/otrs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/s7design/otrs/merges","archive_url":"https://api.github.com/repos/s7design/otrs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/s7design/otrs/downloads","issues_url":"https://api.github.com/repos/s7design/otrs/issues{/number}","pulls_url":"https://api.github.com/repos/s7design/otrs/pulls{/number}","milestones_url":"https://api.github.com/repos/s7design/otrs/milestones{/number}","notifications_url":"https://api.github.com/repos/s7design/otrs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/s7design/otrs/labels{/name}","releases_url":"https://api.github.com/repos/s7design/otrs/releases{/id}","created_at":"2014-01-27T11:35:20Z","updated_at":"2015-02-05T12:30:57Z","pushed_at":"2015-02-05T15:05:21Z","git_url":"git://github.com/s7design/otrs.git","ssh_url":"git@github.com:s7design/otrs.git","clone_url":"https://github.com/s7design/otrs.git","svn_url":"https://github.com/s7design/otrs","homepage":null,"size":199493,"stargazers_count":0,"watchers_count":0,"language":"Perl","has_issues":true,"has_downloads":true,"has_wiki":true,"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":"OTRS:master","ref":"master","sha":"106789ab99dec8905796e746d551a79e0e230cd4","user":{"login":"OTRS","id":3065906,"avatar_url":"https://avatars.githubusercontent.com/u/3065906?v=3","gravatar_id":"","url":"https://api.github.com/users/OTRS","html_url":"https://github.com/OTRS","followers_url":"https://api.github.com/users/OTRS/followers","following_url":"https://api.github.com/users/OTRS/following{/other_user}","gists_url":"https://api.github.com/users/OTRS/gists{/gist_id}","starred_url":"https://api.github.com/users/OTRS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OTRS/subscriptions","organizations_url":"https://api.github.com/users/OTRS/orgs","repos_url":"https://api.github.com/users/OTRS/repos","events_url":"https://api.github.com/users/OTRS/events{/privacy}","received_events_url":"https://api.github.com/users/OTRS/received_events","type":"Organization","site_admin":false},"repo":{"id":16276216,"name":"otrs","full_name":"OTRS/otrs","owner":{"login":"OTRS","id":3065906,"avatar_url":"https://avatars.githubusercontent.com/u/3065906?v=3","gravatar_id":"","url":"https://api.github.com/users/OTRS","html_url":"https://github.com/OTRS","followers_url":"https://api.github.com/users/OTRS/followers","following_url":"https://api.github.com/users/OTRS/following{/other_user}","gists_url":"https://api.github.com/users/OTRS/gists{/gist_id}","starred_url":"https://api.github.com/users/OTRS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OTRS/subscriptions","organizations_url":"https://api.github.com/users/OTRS/orgs","repos_url":"https://api.github.com/users/OTRS/repos","events_url":"https://api.github.com/users/OTRS/events{/privacy}","received_events_url":"https://api.github.com/users/OTRS/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/OTRS/otrs","description":"The OTRS framework.","fork":false,"url":"https://api.github.com/repos/OTRS/otrs","forks_url":"https://api.github.com/repos/OTRS/otrs/forks","keys_url":"https://api.github.com/repos/OTRS/otrs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/OTRS/otrs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/OTRS/otrs/teams","hooks_url":"https://api.github.com/repos/OTRS/otrs/hooks","issue_events_url":"https://api.github.com/repos/OTRS/otrs/issues/events{/number}","events_url":"https://api.github.com/repos/OTRS/otrs/events","assignees_url":"https://api.github.com/repos/OTRS/otrs/assignees{/user}","branches_url":"https://api.github.com/repos/OTRS/otrs/branches{/branch}","tags_url":"https://api.github.com/repos/OTRS/otrs/tags","blobs_url":"https://api.github.com/repos/OTRS/otrs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/OTRS/otrs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/OTRS/otrs/git/refs{/sha}","trees_url":"https://api.github.com/repos/OTRS/otrs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/OTRS/otrs/statuses/{sha}","languages_url":"https://api.github.com/repos/OTRS/otrs/languages","stargazers_url":"https://api.github.com/repos/OTRS/otrs/stargazers","contributors_url":"https://api.github.com/repos/OTRS/otrs/contributors","subscribers_url":"https://api.github.com/repos/OTRS/otrs/subscribers","subscription_url":"https://api.github.com/repos/OTRS/otrs/subscription","commits_url":"https://api.github.com/repos/OTRS/otrs/commits{/sha}","git_commits_url":"https://api.github.com/repos/OTRS/otrs/git/commits{/sha}","comments_url":"https://api.github.com/repos/OTRS/otrs/comments{/number}","issue_comment_url":"https://api.github.com/repos/OTRS/otrs/issues/comments/{number}","contents_url":"https://api.github.com/repos/OTRS/otrs/contents/{+path}","compare_url":"https://api.github.com/repos/OTRS/otrs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/OTRS/otrs/merges","archive_url":"https://api.github.com/repos/OTRS/otrs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/OTRS/otrs/downloads","issues_url":"https://api.github.com/repos/OTRS/otrs/issues{/number}","pulls_url":"https://api.github.com/repos/OTRS/otrs/pulls{/number}","milestones_url":"https://api.github.com/repos/OTRS/otrs/milestones{/number}","notifications_url":"https://api.github.com/repos/OTRS/otrs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/OTRS/otrs/labels{/name}","releases_url":"https://api.github.com/repos/OTRS/otrs/releases{/id}","created_at":"2014-01-27T10:44:13Z","updated_at":"2015-02-05T10:54:45Z","pushed_at":"2015-02-06T10:12:49Z","git_url":"git://github.com/OTRS/otrs.git","ssh_url":"git@github.com:OTRS/otrs.git","clone_url":"https://github.com/OTRS/otrs.git","svn_url":"https://github.com/OTRS/otrs","homepage":null,"size":259450,"stargazers_count":103,"watchers_count":103,"language":"Perl","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":123,"mirror_url":null,"open_issues_count":50,"forks":123,"open_issues":50,"watchers":103,"default_branch":"rel-4_0"}},"_links":{"self":{"href":"https://api.github.com/repos/OTRS/otrs/pulls/430"},"html":{"href":"https://github.com/OTRS/otrs/pull/430"},"issue":{"href":"https://api.github.com/repos/OTRS/otrs/issues/430"},"comments":{"href":"https://api.github.com/repos/OTRS/otrs/issues/430/comments"},"review_comments":{"href":"https://api.github.com/repos/OTRS/otrs/pulls/430/comments"},"review_comment":{"href":"https://api.github.com/repos/OTRS/otrs/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/OTRS/otrs/pulls/430/commits"},"statuses":{"href":"https://api.github.com/repos/OTRS/otrs/statuses/494e4e8397c0c469ce4e21770f7eee5bb43b6a20"}}}}