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

Deprecate meaningless parameter #25259

Merged
merged 1 commit into from
Jan 18, 2023
Merged

Conversation

eileenmcnaughton
Copy link
Contributor

Overview

Deprecate meaningless parameter

Before

If $returnSQL is passed in then the resulting sql is returned via CRM_Core_DAO::composeQuery($sql); - However, this function leaves the sql unchanged if it is the only input parameter (it kicks into gear if $params is passed in as well)

After

simplifed

Technical Details

A universe search suggests only one search has been implemented that overrides this function to use the variable - the full text search

I tried to make sense of the full text search - this function is called from 2 places

  • filling the group contact cache
  • filling the prevnext cache

In the latter case the function would return an integer (a contact ID) - this possibly works because if makes invalid sql which gets caught by the try-catch (which would probably still be true). @lcdservices can maybe help here?

Comments

https://lab.civicrm.org/dev/core/-/issues/4056

@civibot
Copy link

civibot bot commented Jan 2, 2023

(Standard links)

@civibot civibot bot added the master label Jan 2, 2023
return $this->all($offset, $rowcount, $sort, FALSE, TRUE);
}
else {
return CRM_Core_DAO::singleValueQuery("SELECT contact_id FROM {$this->_tableName}");
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See - this returns the results of the query - not the sql itself... and if there is more than one row it ??? - which seems invalid

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK - see comment on main PR thread - I made sense of it

@eileenmcnaughton
Copy link
Contributor Author

eileenmcnaughton commented Jan 2, 2023

Ah that explains it - full text search really doesn't use grup contact cache.... - so with this the behaviour is unchanged & works for PrevNextCache & unchanged & non-functional for GroupContact usage

image

@colemanw colemanw merged commit d079f6a into civicrm:master Jan 18, 2023
@colemanw colemanw deleted the cont_ids branch January 18, 2023 15:30
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.

2 participants