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

Missing array_merge in PageFinder::getQuery?? #1734

Closed
adrianbj opened this issue Mar 8, 2016 · 1 comment
Closed

Missing array_merge in PageFinder::getQuery?? #1734

adrianbj opened this issue Mar 8, 2016 · 1 comment

Comments

@adrianbj
Copy link

adrianbj commented Mar 8, 2016

Not sure on this, but I wonder if:

$options = array_merge($this->defaultOptions, $options);

should be added to the top of the getQuery function. I noticed that without it, if you try do the following:

$selectors = new Selectors("template=basic-page, limit=1000000");
$pagefinder = new PageFinder();
$sql = $pagefinder->getQuery($selectors->getArray(), array())->getQuery();

you get an "Undefined index: returnVerbose" notice.

Obviously you could do this instead:

$sql = $pagefinder->getQuery($selectors->getArray(), array("returnVerbose" => true))->getQuery();

but wonder if the defaults should be populated to this function?

@ryancramerdesign
Copy link
Owner

Adrian, the getQuery() method is a protected method, not meant to be called from outside of the PageFinder class. That's why it relies on the find() method to initialize the $options. Because it's hookable, it still has to be callable by the hooks system, but it's not meant to be used as a public method.

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

No branches or pull requests

2 participants