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

(dev/core#705) Disabling Alphabetical Pager is not respected for events #14203

Merged
merged 1 commit into from
May 7, 2019

Conversation

yashodha
Copy link
Contributor

@yashodha yashodha commented May 6, 2019

Overview

Steps to replicate :

Go to Admin > Search Preferences and turn off Include Alphabetical Pager

A to Z Pager is off for Find Contacts, Find Contributions, etc
However it is still shown on Manage Events.

https://lab.civicrm.org/dev/core/issues/705

Before

Alphabetical Pager is visible on Manage Events

After

Alphabetical Pager is not visible on Manage Events

Comments

This is keeping it consistent with other selectors where Alphabetical Pager is already suppressed. This is in continuation of #13592

@civibot
Copy link

civibot bot commented May 6, 2019

(Standard links)

@civibot civibot bot added the master label May 6, 2019
@@ -314,7 +314,10 @@ public function browse() {
$this->_searchResult = CRM_Utils_Request::retrieve('searchResult', 'Boolean', $this);

$whereClause = $this->whereClause($params, FALSE, $this->_force);
$this->pagerAToZ($whereClause, $params);

if (CRM_Core_Config::singleton()->includeAlphabeticalPager) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if we could do this check in the pagerAToZ function & not everywhere else - seems like you have found a few that got missed & hard to imagine there aren't more. Plus it would be less code duplication

@yashodha
Copy link
Contributor Author

yashodha commented May 7, 2019

@eileenmcnaughton
makes sense, will check

@yashodha
Copy link
Contributor Author

yashodha commented May 7, 2019

@eileenmcnaughton

I don't think we could centralise this more since each of these have their own pagerAToZ method.
https://github.com/civicrm/civicrm-core/blob/master/CRM/Contribute/Page/ContributionPage.php#L676

@eileenmcnaughton
Copy link
Contributor

Sigh - of course they do...

I suspect we could pass in table or something as well but OK - let's not blow this up

Oh by the way - that query you linked to is 'bad'

    $query = "
SELECT DISTINCT UPPER(LEFT(title, 1)) as sort_name
FROM civicrm_contribution_page
WHERE $whereClause
ORDER BY UPPER(LEFT(title, 1))
";

The use of UPPER will block indexing. Handling casing in the php layer speeds up queries. (I doubt anyone has so many contribution pages this is really hurting them although @seamuslee001 has a few.....)

@eileenmcnaughton eileenmcnaughton merged commit 2e5c58f into civicrm:master May 7, 2019
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