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

[search] when a search on word also matches tags #739

plegall opened this Issue Jul 25, 2017 · 1 comment


None yet
1 participant

plegall commented Jul 25, 2017

In the regular search page (search.php), if you "search for words" and check the "tags" box : if your search matches a tag, then on the photo page you get something like:

Notice: Undefined offset: 25 in picture.php on line 244

Warning:  [mysql error 1064] You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 3

  FROM images
  WHERE id IN (1351,1255,)
; in include/dblayer/ on line 845

@plegall plegall added the Type: Bug label Jul 25, 2017

@plegall plegall added this to the 2.9.2 milestone Jul 25, 2017

@plegall plegall self-assigned this Jul 25, 2017


This comment has been minimized.


plegall commented Jul 25, 2017

The problem lies in the list of items returned by get_regular_search_results function : if the search in tags matches some photos which are already found on other photo properties, then the "array_unique" will not reset the numeric keys in the $page['items']. We need to reset the keys.

That's the quick fix. But there is also another issue: the sorting order, when a merge is applied in the results, is not compliant with $conf['order_by']. This should be fixed in the future.

@plegall plegall closed this in 028c4ee Jul 25, 2017

plegall added a commit that referenced this issue Jul 25, 2017

(cp 028c4ee) fixes #739, make sure keys are reset in the "uniquified"…
… array

... for a regular search, when different set of photos matches the search.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment