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

FileSubsite's augmentSQL ID hack only checks first line of query #34

Closed
sminnee opened this issue Mar 31, 2012 · 1 comment
Closed

FileSubsite's augmentSQL ID hack only checks first line of query #34

sminnee opened this issue Mar 31, 2012 · 1 comment

Comments

@sminnee
Copy link
Member

sminnee commented Mar 31, 2012

From http://open.silverstripe.org/ticket/6128

Summary: The hack in the subsites/code/FileSubsites.php class to allow searching for images by ID independent of subsite only checks the first query line. ID is not always the first query (i.e. it may be class).

Possible Solution (yet another hack..): Existing:

if(!$query->where || !preg_match('/\.(\'|"|`|)ID(\'|"|`|)/', $query->where[0])) {

Fixed:

if(!$query->where || !preg_match('/\.(\'|"|`|)ID(\'|"|`|)/', implode(' ', $query->where))) {
moveforward added a commit to moveforward/silverstripe-subsites that referenced this issue Oct 3, 2013
@robbieaverill
Copy link
Contributor

Looks like this has been refactored since 2012 and the code doesn't exist any more. Closing due to inactivity, if anyone experiences this issue still please feel free to open a new issue.

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

No branches or pull requests

2 participants