Skip to content

minor tweeks#1

Closed
bmilesp wants to merge 11 commits into
CakeDC:masterfrom
bmilesp:master
Closed

minor tweeks#1
bmilesp wants to merge 11 commits into
CakeDC:masterfrom
bmilesp:master

Conversation

@bmilesp
Copy link
Copy Markdown
Contributor

@bmilesp bmilesp commented Sep 24, 2010

No description provided.

@d33vil
Copy link
Copy Markdown

d33vil commented May 23, 2011

Please pull these commits :)

@burzum
Copy link
Copy Markdown

burzum commented Oct 12, 2011

I've cherry picked two of the commits the others should be obsolete by the recent changes in the develop branch. If I'm wrong please create another pull requests for the changes against the develop branch. Thanks!

@burzum burzum closed this Oct 12, 2011
@alscheuring alscheuring mentioned this pull request Apr 4, 2012
steinkel pushed a commit that referenced this pull request Nov 12, 2015
ajibarra pushed a commit that referenced this pull request Aug 18, 2017
steinkel pushed a commit that referenced this pull request Jan 18, 2018
 Remove unnecessary translation strings
steinkel pushed a commit that referenced this pull request Apr 18, 2018
steinkel pushed a commit that referenced this pull request Nov 16, 2018
steinkel pushed a commit that referenced this pull request Jan 17, 2019
steinkel pushed a commit that referenced this pull request Mar 3, 2020
@tgoeminne tgoeminne mentioned this pull request Aug 23, 2022
jeanvier added a commit to jeanvier/users that referenced this pull request May 7, 2026
Cake\ORM\Query is a class_alias of Cake\ORM\Query\SelectQuery in
Cake 5, so the legacy import worked at autoload time but PHP's parameter
type checks at the Cake\ORM\BehaviorRegistry::callFinder() entry point
report the canonical class name (SelectQuery) and reject the alias name
(Query) used in the behavior signatures:

  TypeError: CakeDC\\Users\\Model\\Behavior\\OneTimeLoginLinkBehavior::findByOneTimeToken():
  Argument CakeDC#1 ($query) must be of type Cake\\ORM\\Query,
  Cake\\ORM\\Query\\SelectQuery given

This blows up on every request that goes through the OneTimeToken
authenticator (cakedc/auth) because the authenticator calls
$users->loginWithToken($token) on every authenticated request, which
internally fires find('byOneTimeToken') and dispatches to the behavior
finder.

Switch the import to Cake\\ORM\\Query\\SelectQuery and update the
two finder signatures + their docblocks to match. Keeps behaviour
identical, fixes the TypeError.
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 this pull request may close these issues.

3 participants