{"action":"created","issue":{"url":"https://api.github.com/repos/backdrop/backdrop/issues/1130","labels_url":"https://api.github.com/repos/backdrop/backdrop/issues/1130/labels{/name}","comments_url":"https://api.github.com/repos/backdrop/backdrop/issues/1130/comments","events_url":"https://api.github.com/repos/backdrop/backdrop/issues/1130/events","html_url":"https://github.com/backdrop/backdrop/pull/1130","id":121154018,"number":1130,"title":"Issue #1399: Merge Project Browser into core","user":{"login":"docwilmot","id":1042283,"avatar_url":"https://avatars.githubusercontent.com/u/1042283?v=3","gravatar_id":"","url":"https://api.github.com/users/docwilmot","html_url":"https://github.com/docwilmot","followers_url":"https://api.github.com/users/docwilmot/followers","following_url":"https://api.github.com/users/docwilmot/following{/other_user}","gists_url":"https://api.github.com/users/docwilmot/gists{/gist_id}","starred_url":"https://api.github.com/users/docwilmot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/docwilmot/subscriptions","organizations_url":"https://api.github.com/users/docwilmot/orgs","repos_url":"https://api.github.com/users/docwilmot/repos","events_url":"https://api.github.com/users/docwilmot/events{/privacy}","received_events_url":"https://api.github.com/users/docwilmot/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-12-09T03:54:24Z","updated_at":"2015-12-23T01:15:06Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/backdrop/backdrop/pulls/1130","html_url":"https://github.com/backdrop/backdrop/pull/1130","diff_url":"https://github.com/backdrop/backdrop/pull/1130.diff","patch_url":"https://github.com/backdrop/backdrop/pull/1130.patch"},"body":"https://github.com/backdrop/backdrop-issues/issues/1399\r\nFirst pass: Merged PB into Update module, creating a `update.browser.inc`. I think this is reasonable since PB uses Update for install, and there is unlikely to be situations where one would need Update but not PB.\r\n\r\nTodo:\r\n- Redirect to manual install when PB fails?\r\n- Determine if/how/what a PB API would be\r\n- Consistent function names (`update_` and `project_browser_` a bit mixed up now\r\n- Fix project icons. Need a small fix mentioned at https://github.com/backdrop-ops/backdropcms.org/issues/73#issuecomment-163074231. Awaiting advice. we could also use an issue for icons for layouts and modules too, as these currently don't exist, and should.\r\n- Write additional PB tests and merge with Update tests\r\n- Anything else?\r\n"},"comment":{"url":"https://api.github.com/repos/backdrop/backdrop/issues/comments/166772593","html_url":"https://github.com/backdrop/backdrop/pull/1130#issuecomment-166772593","issue_url":"https://api.github.com/repos/backdrop/backdrop/issues/1130","id":166772593,"user":{"login":"docwilmot","id":1042283,"avatar_url":"https://avatars.githubusercontent.com/u/1042283?v=3","gravatar_id":"","url":"https://api.github.com/users/docwilmot","html_url":"https://github.com/docwilmot","followers_url":"https://api.github.com/users/docwilmot/followers","following_url":"https://api.github.com/users/docwilmot/following{/other_user}","gists_url":"https://api.github.com/users/docwilmot/gists{/gist_id}","starred_url":"https://api.github.com/users/docwilmot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/docwilmot/subscriptions","organizations_url":"https://api.github.com/users/docwilmot/orgs","repos_url":"https://api.github.com/users/docwilmot/repos","events_url":"https://api.github.com/users/docwilmot/events{/privacy}","received_events_url":"https://api.github.com/users/docwilmot/received_events","type":"User","site_admin":false},"created_at":"2015-12-23T01:15:06Z","updated_at":"2015-12-23T01:15:06Z","body":"Unstuck perhaps. Managed to fake the XML release data. https://github.com/backdrop/backdrop/compare/1.x...docwilmot:pbtests?expand=1\r\n\r\nBut @quicksketch it will require a small change to `update.fetch.inc`. Change\r\n```\r\nfunction _update_get_fetch_url_base($project) {\r\n  if (isset($project['info']['project status url'])) {\r\n    $url = $project['info']['project status url'];\r\n  }\r\n  else {\r\n    $url = config_get('update.settings', 'update_url');\r\n    if (empty($url)) {\r\n      $url = UPDATE_DEFAULT_URL;\r\n    }\r\n  }\r\n  return $url;\r\n}\r\n```\r\n\r\nto \r\n\r\n```\r\nfunction _update_get_fetch_url_base($project) {\r\n  if (isset($project['info']['project status url'])) {\r\n    $url = $project['info']['project status url'];\r\n  }\r\n  elseif (isset($project['project status url'])) {\r\n    $url = $project['project status url'];\r\n  }\r\n  else {\r\n    $url = config_get('update.settings', 'update_url');\r\n    if (empty($url)) {\r\n      $url = UPDATE_DEFAULT_URL;\r\n    }\r\n  }\r\n  return $url;\r\n}\r\n```\r\n\r\nThis is because the `$project` array created by PB doesn't have an `['info']` key, unlike the `$project` array representing projects during updates and installs. With this addition we could fake a release XML to test the PB install page (not the actual installation).\r\n\r\nThe plot here is to create test project arrays with an `project status url` key referencing a local URL built in `hook_menu()` which then returns an XML string. \r\n\r\nThe install page checks `project_browser_get_project_release_data()` before building the page and all this allows faking release data to let tests proceed."}}