{"action":"created","comment":{"url":"https://api.github.com/repos/ding2/ding2/pulls/comments/264304662","pull_request_review_id":212927836,"id":264304662,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI2NDMwNDY2Mg==","diff_hunk":"@@ -490,25 +490,28 @@ function ding_reservation_reservations_form($form, &$form_state, $reservations,\n   }\n \n   foreach ($reservations as $reservation) {\n-    /** @var \\TingEntity $entity */\n-    $entity = $reservation->entity;\n-    if (!is_object($entity) || NULL === $entity->getTingObject()) {\n-      $entity = ding_provider_get_pseudo_entity($reservation->ding_entity_id);\n-      // Don't link the title as the data well do not known this title. It may\n-      // be a inter library loan.\n-      $title = (!empty($entity) && $entity->getTitle()) ? $entity->getTitle() : $reservation->display_name;\n-    }\n-    else {\n-      // Create title that links to the object.\n+    $title = t('Title not available');\n+    $creators = $mat_type = $cover = NULL;\n+\n+    // If the provider was able to produce an entity we'll use that since we can\n+    // show more information and link to the entity.\n+    if (is_object($reservation->entity)) {\n+      $entity = $reservation->entity;\n+\n       $uri = entity_uri('ting_object', $entity);\n       $title = l($entity->getTitle(), $uri['path']);\n+      $creators = $entity->getCreators();\n+      $mat_type = $entity->getType();\n+      $cover = field_view_field('ting_object', $entity, 'ting_cover', 'user_list');\n+    }\n+    // Else the provider has the option to supply a display name and author.\n+    elseif (!empty($reservation->display_name)) {\n+      $title = $reservation->display_name;\n+      $creators = $reservation->author;\n+    }\n+    else {","path":"modules/ding_reservation/ding_reservation.module","position":33,"original_position":33,"commit_id":"43f9abe10081a1e27b0a2617e701b4e0375a46fa","original_commit_id":"43f9abe10081a1e27b0a2617e701b4e0375a46fa","user":{"login":"holt83","id":5011234,"node_id":"MDQ6VXNlcjUwMTEyMzQ=","avatar_url":"https://avatars3.githubusercontent.com/u/5011234?v=4","gravatar_id":"","url":"https://api.github.com/users/holt83","html_url":"https://github.com/holt83","followers_url":"https://api.github.com/users/holt83/followers","following_url":"https://api.github.com/users/holt83/following{/other_user}","gists_url":"https://api.github.com/users/holt83/gists{/gist_id}","starred_url":"https://api.github.com/users/holt83/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/holt83/subscriptions","organizations_url":"https://api.github.com/users/holt83/orgs","repos_url":"https://api.github.com/users/holt83/repos","events_url":"https://api.github.com/users/holt83/events{/privacy}","received_events_url":"https://api.github.com/users/holt83/received_events","type":"User","site_admin":false},"body":"I missed that one. It's not needed. Will remove.","created_at":"2019-03-11T16:01:27Z","updated_at":"2019-03-11T16:01:28Z","html_url":"https://github.com/ding2/ding2/pull/1384#discussion_r264304662","pull_request_url":"https://api.github.com/repos/ding2/ding2/pulls/1384","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/ding2/ding2/pulls/comments/264304662"},"html":{"href":"https://github.com/ding2/ding2/pull/1384#discussion_r264304662"},"pull_request":{"href":"https://api.github.com/repos/ding2/ding2/pulls/1384"}},"in_reply_to_id":264292947},"pull_request":{"url":"https://api.github.com/repos/ding2/ding2/pulls/1384","id":259132001,"node_id":"MDExOlB1bGxSZXF1ZXN0MjU5MTMyMDAx","html_url":"https://github.com/ding2/ding2/pull/1384","diff_url":"https://github.com/ding2/ding2/pull/1384.diff","patch_url":"https://github.com/ding2/ding2/pull/1384.patch","issue_url":"https://api.github.com/repos/ding2/ding2/issues/1384","number":1384,"state":"open","locked":false,"title":"3936: Fix missing titles for ILL on loan/reservation","user":{"login":"holt83","id":5011234,"node_id":"MDQ6VXNlcjUwMTEyMzQ=","avatar_url":"https://avatars3.githubusercontent.com/u/5011234?v=4","gravatar_id":"","url":"https://api.github.com/users/holt83","html_url":"https://github.com/holt83","followers_url":"https://api.github.com/users/holt83/followers","following_url":"https://api.github.com/users/holt83/following{/other_user}","gists_url":"https://api.github.com/users/holt83/gists{/gist_id}","starred_url":"https://api.github.com/users/holt83/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/holt83/subscriptions","organizations_url":"https://api.github.com/users/holt83/orgs","repos_url":"https://api.github.com/users/holt83/repos","events_url":"https://api.github.com/users/holt83/events{/privacy}","received_events_url":"https://api.github.com/users/holt83/received_events","type":"User","site_admin":false},"body":"#### Link to issue\r\n\r\nhttps://platform.dandigbib.org/issues/3936\r\n\r\n#### Description\r\n\r\nIn the latest versions a lot of libraries has experienced the \"Error: unknown/missing/inaccessible record:\" problem with materials on statuslists.\r\n\r\nI have posted a pretty hacky attempt to fix this here: https://github.com/ding2/ding2/pull/1293, but it relies on a weird way of handling not-found object in opensearch getObject. We are in contact with DBC and they will update opensearch to handle it in a better way.\r\n\r\nThis should only be a problem with ILL loans/reservations since we should be able to always get an entity for materials in the libraries own catalog.\r\n\r\nDuring analysis in https://platform.dandigbib.org/issues/3936 we have found out that we actually shouldn't try to make a request against opensearch at all for ILL, since the ID we recieve from FBS API isn't guaranteed to be a faust and hence there's a risk for collisions with wrong materials from other sources than the library catalog.\r\n\r\nSo I believe a better fix for this right now is to **not** make an opensearch request for ILL. This should fix all the cases with  \"Error: unknown/missing/inaccessible record:\" on loan/reservation.\r\n\r\nThe main approach is that we don't send a ding_entity_id from the providers when we have an ILL-bibliographic record on the response from FBS API. Ding_loan/reservation will check for the entity and if provider didn't set ding_entity_id, NULL will be returned. Before we were actually sending a wrong ding_entity_id in some cases.\r\n\r\nWe will still have problem with debts, since we have no idea whether it's ILL there. But we will handle that in another case, since we will have to wait for Systematic to (hopefully) update the API with more ILL-information.\r\n\r\nOff course we should also try to fix the \"Errors as real object\"-problem that my previous PR tried to address, but we will also handle that in another case, since we will have to wait for DBC to update opensearch.\r\n\r\n#### Checklist\r\n\r\n- [x] My complies with [our coding guidelines](../docs/code_guidelines.md).\r\n- [x] My code passes our static analysis suite. If not then I have added a comment explaining why this change should be exempt from the code standards and process.\r\n- [x] My code passes our continuous integration process. If not then I have added a comment explaining why this change should be exempt from the code standards and process.\r\n\r\n#### Additional comments or questions\r\n\r\nI found a weird quirk in the DingProviderReservation and DingProviderLoan objects, where it would try to make a very problematic opensearch request, when the object has been serialized in ding_session_cache(). More about that in the related commit message.\r\n\r\nTbh I'm not really a fan of these classes, and have a very hard time seeing the usefulness of all the complexity in these, but I have tried to fix this without changing too much.\r\n\r\nI did experience much better performance on the status lists after fixing it, because it doesn't make the very problematic request agaisnt opensearch. \r\n","created_at":"2019-03-07T14:22:47Z","updated_at":"2019-03-11T16:01:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0102c0861b9a8cef5bae44a072d76b54a31b8ba9","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/ding2/ding2/pulls/1384/commits","review_comments_url":"https://api.github.com/repos/ding2/ding2/pulls/1384/comments","review_comment_url":"https://api.github.com/repos/ding2/ding2/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ding2/ding2/issues/1384/comments","statuses_url":"https://api.github.com/repos/ding2/ding2/statuses/43f9abe10081a1e27b0a2617e701b4e0375a46fa","head":{"label":"vejlebib:3936-use-ill","ref":"3936-use-ill","sha":"43f9abe10081a1e27b0a2617e701b4e0375a46fa","user":{"login":"vejlebib","id":326328,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMyNjMyOA==","avatar_url":"https://avatars2.githubusercontent.com/u/326328?v=4","gravatar_id":"","url":"https://api.github.com/users/vejlebib","html_url":"https://github.com/vejlebib","followers_url":"https://api.github.com/users/vejlebib/followers","following_url":"https://api.github.com/users/vejlebib/following{/other_user}","gists_url":"https://api.github.com/users/vejlebib/gists{/gist_id}","starred_url":"https://api.github.com/users/vejlebib/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vejlebib/subscriptions","organizations_url":"https://api.github.com/users/vejlebib/orgs","repos_url":"https://api.github.com/users/vejlebib/repos","events_url":"https://api.github.com/users/vejlebib/events{/privacy}","received_events_url":"https://api.github.com/users/vejlebib/received_events","type":"Organization","site_admin":false},"repo":{"id":14683578,"node_id":"MDEwOlJlcG9zaXRvcnkxNDY4MzU3OA==","name":"ding2","full_name":"vejlebib/ding2","private":false,"owner":{"login":"vejlebib","id":326328,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMyNjMyOA==","avatar_url":"https://avatars2.githubusercontent.com/u/326328?v=4","gravatar_id":"","url":"https://api.github.com/users/vejlebib","html_url":"https://github.com/vejlebib","followers_url":"https://api.github.com/users/vejlebib/followers","following_url":"https://api.github.com/users/vejlebib/following{/other_user}","gists_url":"https://api.github.com/users/vejlebib/gists{/gist_id}","starred_url":"https://api.github.com/users/vejlebib/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vejlebib/subscriptions","organizations_url":"https://api.github.com/users/vejlebib/orgs","repos_url":"https://api.github.com/users/vejlebib/repos","events_url":"https://api.github.com/users/vejlebib/events{/privacy}","received_events_url":"https://api.github.com/users/vejlebib/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/vejlebib/ding2","description":"Vejlebib CMS based on ding2","fork":true,"url":"https://api.github.com/repos/vejlebib/ding2","forks_url":"https://api.github.com/repos/vejlebib/ding2/forks","keys_url":"https://api.github.com/repos/vejlebib/ding2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vejlebib/ding2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vejlebib/ding2/teams","hooks_url":"https://api.github.com/repos/vejlebib/ding2/hooks","issue_events_url":"https://api.github.com/repos/vejlebib/ding2/issues/events{/number}","events_url":"https://api.github.com/repos/vejlebib/ding2/events","assignees_url":"https://api.github.com/repos/vejlebib/ding2/assignees{/user}","branches_url":"https://api.github.com/repos/vejlebib/ding2/branches{/branch}","tags_url":"https://api.github.com/repos/vejlebib/ding2/tags","blobs_url":"https://api.github.com/repos/vejlebib/ding2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vejlebib/ding2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vejlebib/ding2/git/refs{/sha}","trees_url":"https://api.github.com/repos/vejlebib/ding2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vejlebib/ding2/statuses/{sha}","languages_url":"https://api.github.com/repos/vejlebib/ding2/languages","stargazers_url":"https://api.github.com/repos/vejlebib/ding2/stargazers","contributors_url":"https://api.github.com/repos/vejlebib/ding2/contributors","subscribers_url":"https://api.github.com/repos/vejlebib/ding2/subscribers","subscription_url":"https://api.github.com/repos/vejlebib/ding2/subscription","commits_url":"https://api.github.com/repos/vejlebib/ding2/commits{/sha}","git_commits_url":"https://api.github.com/repos/vejlebib/ding2/git/commits{/sha}","comments_url":"https://api.github.com/repos/vejlebib/ding2/comments{/number}","issue_comment_url":"https://api.github.com/repos/vejlebib/ding2/issues/comments{/number}","contents_url":"https://api.github.com/repos/vejlebib/ding2/contents/{+path}","compare_url":"https://api.github.com/repos/vejlebib/ding2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vejlebib/ding2/merges","archive_url":"https://api.github.com/repos/vejlebib/ding2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vejlebib/ding2/downloads","issues_url":"https://api.github.com/repos/vejlebib/ding2/issues{/number}","pulls_url":"https://api.github.com/repos/vejlebib/ding2/pulls{/number}","milestones_url":"https://api.github.com/repos/vejlebib/ding2/milestones{/number}","notifications_url":"https://api.github.com/repos/vejlebib/ding2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vejlebib/ding2/labels{/name}","releases_url":"https://api.github.com/repos/vejlebib/ding2/releases{/id}","deployments_url":"https://api.github.com/repos/vejlebib/ding2/deployments","created_at":"2013-11-25T11:13:17Z","updated_at":"2019-02-04T12:25:56Z","pushed_at":"2019-03-08T11:29:40Z","git_url":"git://github.com/vejlebib/ding2.git","ssh_url":"git@github.com:vejlebib/ding2.git","clone_url":"https://github.com/vejlebib/ding2.git","svn_url":"https://github.com/vejlebib/ding2","homepage":"","size":103903,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":3,"open_issues":1,"watchers":0,"default_branch":"vejlebib"}},"base":{"label":"ding2:master","ref":"master","sha":"5cf3e2e88eee75f323bc23468d00f582221f52b1","user":{"login":"ding2","id":564698,"node_id":"MDEyOk9yZ2FuaXphdGlvbjU2NDY5OA==","avatar_url":"https://avatars0.githubusercontent.com/u/564698?v=4","gravatar_id":"","url":"https://api.github.com/users/ding2","html_url":"https://github.com/ding2","followers_url":"https://api.github.com/users/ding2/followers","following_url":"https://api.github.com/users/ding2/following{/other_user}","gists_url":"https://api.github.com/users/ding2/gists{/gist_id}","starred_url":"https://api.github.com/users/ding2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ding2/subscriptions","organizations_url":"https://api.github.com/users/ding2/orgs","repos_url":"https://api.github.com/users/ding2/repos","events_url":"https://api.github.com/users/ding2/events{/privacy}","received_events_url":"https://api.github.com/users/ding2/received_events","type":"Organization","site_admin":false},"repo":{"id":1266749,"node_id":"MDEwOlJlcG9zaXRvcnkxMjY2NzQ5","name":"ding2","full_name":"ding2/ding2","private":false,"owner":{"login":"ding2","id":564698,"node_id":"MDEyOk9yZ2FuaXphdGlvbjU2NDY5OA==","avatar_url":"https://avatars0.githubusercontent.com/u/564698?v=4","gravatar_id":"","url":"https://api.github.com/users/ding2","html_url":"https://github.com/ding2","followers_url":"https://api.github.com/users/ding2/followers","following_url":"https://api.github.com/users/ding2/following{/other_user}","gists_url":"https://api.github.com/users/ding2/gists{/gist_id}","starred_url":"https://api.github.com/users/ding2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ding2/subscriptions","organizations_url":"https://api.github.com/users/ding2/orgs","repos_url":"https://api.github.com/users/ding2/repos","events_url":"https://api.github.com/users/ding2/events{/privacy}","received_events_url":"https://api.github.com/users/ding2/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/ding2/ding2","description":"Ding install profile","fork":false,"url":"https://api.github.com/repos/ding2/ding2","forks_url":"https://api.github.com/repos/ding2/ding2/forks","keys_url":"https://api.github.com/repos/ding2/ding2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ding2/ding2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ding2/ding2/teams","hooks_url":"https://api.github.com/repos/ding2/ding2/hooks","issue_events_url":"https://api.github.com/repos/ding2/ding2/issues/events{/number}","events_url":"https://api.github.com/repos/ding2/ding2/events","assignees_url":"https://api.github.com/repos/ding2/ding2/assignees{/user}","branches_url":"https://api.github.com/repos/ding2/ding2/branches{/branch}","tags_url":"https://api.github.com/repos/ding2/ding2/tags","blobs_url":"https://api.github.com/repos/ding2/ding2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ding2/ding2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ding2/ding2/git/refs{/sha}","trees_url":"https://api.github.com/repos/ding2/ding2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ding2/ding2/statuses/{sha}","languages_url":"https://api.github.com/repos/ding2/ding2/languages","stargazers_url":"https://api.github.com/repos/ding2/ding2/stargazers","contributors_url":"https://api.github.com/repos/ding2/ding2/contributors","subscribers_url":"https://api.github.com/repos/ding2/ding2/subscribers","subscription_url":"https://api.github.com/repos/ding2/ding2/subscription","commits_url":"https://api.github.com/repos/ding2/ding2/commits{/sha}","git_commits_url":"https://api.github.com/repos/ding2/ding2/git/commits{/sha}","comments_url":"https://api.github.com/repos/ding2/ding2/comments{/number}","issue_comment_url":"https://api.github.com/repos/ding2/ding2/issues/comments{/number}","contents_url":"https://api.github.com/repos/ding2/ding2/contents/{+path}","compare_url":"https://api.github.com/repos/ding2/ding2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ding2/ding2/merges","archive_url":"https://api.github.com/repos/ding2/ding2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ding2/ding2/downloads","issues_url":"https://api.github.com/repos/ding2/ding2/issues{/number}","pulls_url":"https://api.github.com/repos/ding2/ding2/pulls{/number}","milestones_url":"https://api.github.com/repos/ding2/ding2/milestones{/number}","notifications_url":"https://api.github.com/repos/ding2/ding2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ding2/ding2/labels{/name}","releases_url":"https://api.github.com/repos/ding2/ding2/releases{/id}","deployments_url":"https://api.github.com/repos/ding2/ding2/deployments","created_at":"2011-01-18T10:54:00Z","updated_at":"2019-03-06T07:54:00Z","pushed_at":"2019-03-11T15:59:56Z","git_url":"git://github.com/ding2/ding2.git","ssh_url":"git@github.com:ding2/ding2.git","clone_url":"https://github.com/ding2/ding2.git","svn_url":"https://github.com/ding2/ding2","homepage":"","size":100191,"stargazers_count":14,"watchers_count":14,"language":"PHP","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":50,"mirror_url":null,"archived":false,"open_issues_count":167,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":50,"open_issues":167,"watchers":14,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ding2/ding2/pulls/1384"},"html":{"href":"https://github.com/ding2/ding2/pull/1384"},"issue":{"href":"https://api.github.com/repos/ding2/ding2/issues/1384"},"comments":{"href":"https://api.github.com/repos/ding2/ding2/issues/1384/comments"},"review_comments":{"href":"https://api.github.com/repos/ding2/ding2/pulls/1384/comments"},"review_comment":{"href":"https://api.github.com/repos/ding2/ding2/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ding2/ding2/pulls/1384/commits"},"statuses":{"href":"https://api.github.com/repos/ding2/ding2/statuses/43f9abe10081a1e27b0a2617e701b4e0375a46fa"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"holt83"}}