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

PHP Notice with last CakePHP version #28

Closed
viniciusbig opened this issue Oct 3, 2018 · 7 comments · Fixed by #29
Closed

PHP Notice with last CakePHP version #28

viniciusbig opened this issue Oct 3, 2018 · 7 comments · Fixed by #29

Comments

@viniciusbig
Copy link

CakeDC/Users is breaking with the recently released CakePHP 3.6.12.

Notice (1024): Undefined property: PagesController::$Cookie in /cakesandbox/vendor/cakedc/auth/src/Auth/RememberMeAuthenticate.php on line 42 [CORE/src/Controller/Controller.php, line 387]

I'm using CakeDC/Users and this repo is a dependency.

@viniciusbig
Copy link
Author

viniciusbig commented Oct 4, 2018

I could reproduce the error in a fresh install of cake.

  • install a fresh cake. (3.6.12)
  • install cakedc/users
  • load plugin and migrations
  • try to open my_app.dev/users/users

Apparently, cakephp 3.6.12 is throwing notices for undefined properties.

@steinkel
Copy link
Member

steinkel commented Oct 4, 2018

thank you for reporting it, we noticed it too and a fix is on its way...

@thumbtech
Copy link

FYI inclusion of
$this->loadComponent('Cookie'); // to support old CakeDC/Auth
in controller initialize will handle this.

However, this cookie component has been deprecated since 3.5.0, so fix should go to new cookies and dependency noted.

@steinkel
Copy link
Member

steinkel commented Oct 9, 2018

We actually require 3.6
https://github.com/CakeDC/auth/blob/master/composer.json#L29

so the fix should not break existing code... are you experiencing issues after the fix?

Thanks,

@thumbtech
Copy link

Yes thanks 3.0.1 fixed!

Although if requiring 3.6, why not go the
... $cookie = $request->getCookie($cookieName); ...
route?

@steinkel
Copy link
Member

steinkel commented Oct 9, 2018

yes, that could be an improvement, keep in mind we have a refactor in progress to use the new cakephp/authentication plugin and some other improvements, so it'll make sense to wait until we manage to merge it.

Thanks,

@gerrymcdonnell
Copy link

gerrymcdonnell commented Sep 7, 2021

FYI inclusion of
$this->loadComponent('Cookie'); // to support old CakeDC/Auth
in controller initialize will handle this.

However, this cookie component has been deprecated since 3.5.0, so fix should go to new cookies and dependency noted.

Thanks for that, fixed an issue i had with cake 3.6 and cakedc/users": "^6.0.1

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 a pull request may close this issue.

4 participants