{"action":"created","issue":{"url":"https://api.github.com/repos/civicrm/civicrm-core/issues/12664","repository_url":"https://api.github.com/repos/civicrm/civicrm-core","labels_url":"https://api.github.com/repos/civicrm/civicrm-core/issues/12664/labels{/name}","comments_url":"https://api.github.com/repos/civicrm/civicrm-core/issues/12664/comments","events_url":"https://api.github.com/repos/civicrm/civicrm-core/issues/12664/events","html_url":"https://github.com/civicrm/civicrm-core/pull/12664","id":350586344,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA4NDAxNDc2","number":12664,"title":"(dev/core#217) PrevNext - Remove references to entity_table and entity_id2 from service. Add test.","user":{"login":"totten","id":1336047,"node_id":"MDQ6VXNlcjEzMzYwNDc=","avatar_url":"https://avatars0.githubusercontent.com/u/1336047?v=4","gravatar_id":"","url":"https://api.github.com/users/totten","html_url":"https://github.com/totten","followers_url":"https://api.github.com/users/totten/followers","following_url":"https://api.github.com/users/totten/following{/other_user}","gists_url":"https://api.github.com/users/totten/gists{/gist_id}","starred_url":"https://api.github.com/users/totten/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/totten/subscriptions","organizations_url":"https://api.github.com/users/totten/orgs","repos_url":"https://api.github.com/users/totten/repos","events_url":"https://api.github.com/users/totten/events{/privacy}","received_events_url":"https://api.github.com/users/totten/received_events","type":"User","site_admin":false},"labels":[{"id":246037889,"node_id":"MDU6TGFiZWwyNDYwMzc4ODk=","url":"https://api.github.com/repos/civicrm/civicrm-core/labels/master","name":"master","color":"0052cc","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-08-14T20:31:19Z","updated_at":"2018-08-17T03:42:14Z","closed_at":null,"author_association":"MEMBER","pull_request":{"url":"https://api.github.com/repos/civicrm/civicrm-core/pulls/12664","html_url":"https://github.com/civicrm/civicrm-core/pull/12664","diff_url":"https://github.com/civicrm/civicrm-core/pull/12664.diff","patch_url":"https://github.com/civicrm/civicrm-core/pull/12664.patch"},"body":"Overview\r\n----------------------------------------\r\n\r\n> NOTE: To avoid merge-conflicts, this PR extends/depends on #12663 -- which modifies similar sections of code. All these changes originated in #12377.\r\n\r\nThe PrevNext service/interface aims to be a [replaceable component for use in search-caching (dev/core#217)](https://lab.civicrm.org/dev/core/issues/217) (but not deduping). Continuing in that thread, the prev/next interface is being split in two:\r\n\r\n* `CRM_Core_PrevNextCache_Interface` and `Civi::service('prevnext')` are used for search-caching.\r\n* `CRM_Core_BAO_PrevNextCache` is used for deduping.\r\n\r\nCurrently, the codebase has a draft`CRM_Core_PrevNextCache_Interface` produced from refactoring. It includes several references to `entity_table` and `entity_id2` -- these values are part of the SQL table, and they're needed for dedupe, but they don't seem to convey anything meaningful for search-caching.  Including these fields makes the interface more complicated -- which makes it hard to implement other backends.\r\n\r\nThe general gist of this commit is that (for purposes of search-caching) we no longer fill those two columns, and we no longer read them. The revised function signatures are now unit-tested.\r\n\r\nBoth Before and After\r\n----------------------------------------\r\n* The interface and implementation of `CRM_Core_BAO_PrevNextCache` remain the same -- so that dedupe use-cases can continue to read/write `$entity_table` and `$id2`.\r\n\r\nBefore\r\n----------------------------------------\r\n* The schema for `civicrm_prevnext_cache` specifies `entity_id2` as mandatory.\r\n* `CRM_Core_PrevNextCache_Interface::fillWithSql()` accepts a SQL query that includes `entity_table` and `entity_id2` (among others). Callers provide these.\r\n* `CRM_Core_PrevNextCache_Interface::getPositions()` accepts `$id2` (among others).\r\n* `CRM_Core_PrevNextCache_Interface::deleteItem()` accepts `$entity_table` (among others).\r\n* There is no test-coverage for `CRM_Core_PrevNextCache_Interface`.\r\n\r\nAfter\r\n----------------------------------------\r\n* The schema for `civicrm_prevnext_cache` specifies `entity_id2` as optional.\r\n* `CRM_Core_PrevNextCache_Interface::fillWithSql()` accepts a SQL query that does *not*  include `entity_table` and `entity_id2`. Callers do *not* provide these.\r\n* `CRM_Core_PrevNextCache_Interface::getPositions()` no longer accepts `$id2`. The implementation has been forked from the BAO's implementation.\r\n* `CRM_Core_PrevNextCache_Interface::deleteItem()` no longer accepts `$entity_table`. The implementation has been forked from the BAO's implementation.\r\n* The test `E2E_Core_PrevNextTest` covers `CRM_Core_PrevNextCache_Interface`\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/civicrm/civicrm-core/issues/comments/413749009","html_url":"https://github.com/civicrm/civicrm-core/pull/12664#issuecomment-413749009","issue_url":"https://api.github.com/repos/civicrm/civicrm-core/issues/12664","id":413749009,"node_id":"MDEyOklzc3VlQ29tbWVudDQxMzc0OTAwOQ==","user":{"login":"eileenmcnaughton","id":336308,"node_id":"MDQ6VXNlcjMzNjMwOA==","avatar_url":"https://avatars2.githubusercontent.com/u/336308?v=4","gravatar_id":"","url":"https://api.github.com/users/eileenmcnaughton","html_url":"https://github.com/eileenmcnaughton","followers_url":"https://api.github.com/users/eileenmcnaughton/followers","following_url":"https://api.github.com/users/eileenmcnaughton/following{/other_user}","gists_url":"https://api.github.com/users/eileenmcnaughton/gists{/gist_id}","starred_url":"https://api.github.com/users/eileenmcnaughton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eileenmcnaughton/subscriptions","organizations_url":"https://api.github.com/users/eileenmcnaughton/orgs","repos_url":"https://api.github.com/users/eileenmcnaughton/repos","events_url":"https://api.github.com/users/eileenmcnaughton/events{/privacy}","received_events_url":"https://api.github.com/users/eileenmcnaughton/received_events","type":"User","site_admin":false},"created_at":"2018-08-17T03:42:14Z","updated_at":"2018-08-17T03:42:14Z","author_association":"CONTRIBUTOR","body":"test this please"}}
{"actor":{"display_login":"eileenmcnaughton"}}