Skip to content

Conversation

@MCF
Copy link
Contributor

@MCF MCF commented Apr 22, 2017

  • There is a bug in the exising findTagged function. When calling the
    function without any tags specified all bookmarks are returned, rather
    than the bookmarks that have no associated tags.
  • The alternative query (tags specified) was also adjusted to use a
    similar approach - specifying the conditional after the join, rather
    than in it, IMHO making the logic a little clearer.

- There is a bug in the exising findTagged function.  When calling the
  function without any tags specified all bookmarks are returned, rather
  than the bookmarks that have no associated tags.
- The alternative query (tags specified) was also adjusted to use a
  similar approach - specifying the conditional after the join, rather
  than in it, IMHO making the logic a little clearer.
@MCF
Copy link
Contributor Author

MCF commented Apr 22, 2017

For a short discussion of why the conditional in the left join does not work the same as a where clause please see:

http://stackoverflow.com/questions/354070/sql-join-where-clause-vs-on-clause

@MCF
Copy link
Contributor Author

MCF commented Apr 22, 2017

On a related note the paragraph that follows the findTagged code sample discusses the much older version of that function (changed in PR #4609). That paragraph should be updated to match the new code example. But I guess we should wait until everyone is happy with the function before making that change.

@markstory markstory modified the milestones: 4.x, 2.x, 3.x Apr 23, 2017
@markstory markstory merged commit 4cf867c into cakephp:3.0 Apr 23, 2017
@markstory
Copy link
Member

Thanks!

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants