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

REFACTOR LocatorController index() - remove getTrigger() check for loading Locations on page load #219

Open
jsirish opened this issue Jan 22, 2020 · 0 comments · Fixed by #220

Comments

@jsirish
Copy link
Member

jsirish commented Jan 22, 2020

Is your feature request related to a problem? Please describe.
The getTrigger() was meant to prevent locations from loading on page load, by checking if the GET variable was set for the field marked as query_trigger. The ability to not load all location results prior to a search is to ensure performance with a larger set of Locations (100+).

The getTrigger() method is more complicated than it needs to be.

Describe the solution you'd like
In index(), replace the getTrigger() check with a check against a $db boolean on Locator class that can be set via the CMS. Default is false. If marked true, all results would display on initial page load.

Describe alternatives you've considered
Instead adding a config via yaml to set default behavior for the class. This offers less flexibility without subclassing Locator so the config can be different.

jsirish added a commit to jsirish/silverstripe-locator that referenced this issue Jan 22, 2020
Check if any GET vars exist, or if static $db ResultsOnLoad is true. If so, display results.

closes dynamic#219
muskie9 pushed a commit that referenced this issue Jun 1, 2022
* REFACTOR Locator - getTrigger

Check if any GET vars exist, or if static $db ResultsOnLoad is true. If so, display results.

closes #219

* travis tweak

* phpcs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant