Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove calls & deprecate CRM_Core_BAO_PrevNextCache::setItem #16696

Merged
merged 1 commit into from
Mar 8, 2020

Conversation

eileenmcnaughton
Copy link
Contributor

@eileenmcnaughton eileenmcnaughton commented Mar 6, 2020

Overview

Remove calls & deprecate CRM_Core_BAO_PrevNextCache::setItem

Before

Remove calls & deprecate CRM_Core_BAO_PrevNextCache::setItem Function called twice - but trivially - no reduction in code lines or readability improvement from doing so

After

Remove calls & deprecate CRM_Core_BAO_PrevNextCache::setItem unused & deprecated

Technical Details

We have this function which

  1. is mildly misleading - it appears to be generic to the prevnext table but is actually
    only relevant to deduping as searches no longer use it
  2. is about 50% deprecated and
  3. the remainder is a single insert
  4. is called from 2 places which use it a little differently

I think it's not really adding much value - I was going to remove the deprecated code
but I think in fact the goal should be to remove the whole function.

In general I think code on CRM_Core_BAO_PrevNextCache that is really dedupe-only code
should be on the dedupe classes. The history is that prevnext was created for searches
and kindof twisted to support dedupe as well but now search doesn't use much of what
is in the BAO class (if any)

Comments

@civibot
Copy link

civibot bot commented Mar 6, 2020

(Standard links)

We have this function which

1) is mildly misleading - it appears to be generic to the prevnext table but is actually
only relevant to deduping as searches no longer use it
2) is about 50% deprecated and
3) the remainder is a single insert
4) is called from 2 places which use it a little differently

I think it's not really adding much value - I was going to remove the deprecated code
but I think in fact the goal should be to remove the whole function.

In general I think code on CRM_Core_BAO_PrevNextCache that is really dedupe-only code
should be on the dedupe classes. The history is that prevnext was created for searches
and kindof twisted to support dedupe as well but now search doesn't use much of what
is in the BAO class (if any)
@eileenmcnaughton
Copy link
Contributor Author

test this please

@seamuslee001
Copy link
Contributor

@eileenmcnaughton i'm generally ok with the direction of this but i still feel like having a central function that does the insert/update makes sense to me, But if that means its on the Dedupe class then fine tbh

@eileenmcnaughton
Copy link
Contributor Author

@seamuslee001 I think 'parseAndStoreDupePairs' is a reasonable function name for doing this - which is the calling function. The only other place is kind of a hack so not sharing & eventually moving towards a better plan makes sense

@eileenmcnaughton
Copy link
Contributor Author

@seamuslee001 passing now

@colemanw colemanw merged commit 729bb6f into civicrm:master Mar 8, 2020
@eileenmcnaughton eileenmcnaughton deleted the remove branch March 8, 2020 08:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants