Log message #4262018

# At Username Text
# Apr 26th 2021, 16:17 neon1024 It cannot be sidestepped either `* @var \Cake\Shell\Helper\ProgressHelper|\Cake\Console\Helper` :x:
# Apr 26th 2021, 16:17 neon1024 Perhaps the ProgressHelper is only for Shells? ..and not Commands? :thinking_face:
# Apr 26th 2021, 16:15 neon1024 Anyone else have an issue in 3.x with `$io->helper('Progress')` having an `@return \Cake\Console\Helper` which makes PHP Stan angry, because it’s not an instance of `\Cake\Shell\Helper\ProgressHelper` is there supposed to be a mismatch between `\Console` and `\Shell` ??
# Apr 26th 2021, 16:15 kevin.pfeifer thats at least whats in cakedc/user default values is set https://github.com/CakeDC/users/blob/master/config/users.php#L95
# Apr 26th 2021, 16:14 kevin.pfeifer try `'expires' => new \DateTime('+1 month'),`
# Apr 26th 2021, 16:13 ndm What "what" might be?
# Apr 26th 2021, 16:13 tyler.adam.lazenby maybe every quarter
# Apr 26th 2021, 16:13 tyler.adam.lazenby I don't want my users having to log in every month
# Apr 26th 2021, 16:12 tyler.adam.lazenby do you have a suggestion what that might be? I am thinking maybe once ever few years...
# Apr 26th 2021, 16:08 ndm Set an actual expiration, `null` means client default, which is until session ends.
# Apr 26th 2021, 16:05 tyler.adam.lazenby Am I supposed to add anything to UsersController::login?
# Apr 26th 2021, 15:54 tyler.adam.lazenby so I am confused
# Apr 26th 2021, 15:54 tyler.adam.lazenby But the default for the cookie.expires is null
# Apr 26th 2021, 15:54 tyler.adam.lazenby I noticed when I inspect the cookie, that the expire is set to expire when the session ends
# Apr 26th 2021, 15:53 tyler.adam.lazenby I wish it was that easy
# Apr 26th 2021, 15:53 greg138 That would have been an obvious and easy fix. :(
# Apr 26th 2021, 15:53 tyler.adam.lazenby Nope
# Apr 26th 2021, 15:53 greg138 You're not browsing in private / incognito mode, are you?
# Apr 26th 2021, 15:49 tyler.adam.lazenby don't mind the notes, that was from a previous version
# Apr 26th 2021, 15:49 slackebot 'urlChecker' => DefaultUrlChecker::class, 'loginUrl' => $loginUrl, 'passwordHasher' => DefaultPasswordHasher::class ]);```
# Apr 26th 2021, 15:49 slackebot 'fields' => $fields, 'loginUrl' => $loginUrl, ]); $service->loadAuthenticator('Authentication.Session'); $service->loadAuthenticator('Authentication.Cookie', [ 'rememberMeField' => 'remember_me', 'cookie' => [ 'name' => 'CookieAuth', 'expires' => null, 'path' => '/', 'domain' => '', 'secure' => false, 'httponly' => false, 'value' => '', ], 'fields' => $fields,
# Apr 26th 2021, 15:49 tyler.adam.lazenby ```$fields = [ 'username' => 'login', 'password' => 'password', ]; $loginUrl = '/users/login'; // Load identifiers $service->loadIdentifier('Authentication.Password', [ 'fields' => [ 'username' => ['email', 'login'], 'password' => IdentifierInterface::CREDENTIAL_PASSWORD, ], ]); // Load the authentication, you want session first $service->loadAuthenticator('Authentication.Form', [
# Apr 26th 2021, 15:49 tyler.adam.lazenby I am wondering why it is that whenever I close my browser (essentionally ending my session) why my remember_me cookie isn't allowing me to open my browser back up and stay signed in?
# Apr 26th 2021, 14:33 greg138 To be clear, @noel, you're calling `$this->belongsTo('Notaries', ['className' => 'People', 'foreignKey' => 'person_id']);` where `$this` is the Enquiries table? In that case, I believe it's 100% expected that the People table would not be affected at all. If you want an association to show up on People, you have to add it to People.
# Apr 26th 2021, 10:04 rightscoreanalysis perfectamente - thanks!
# Apr 26th 2021, 09:54 noel @rightscoreanalysis https://book.cakephp.org/migrations/3/en/index.html
# Apr 26th 2021, 09:52 rightscoreanalysis Does Cake have took to keep track of database changes. In Magento for example any changes to db structure can added to a script and a db table tracks the current version and will execute any updates if the version is outdated, is there a similar tool for Cake?
# Apr 26th 2021, 09:36 noel I’ve taken the plunge and raised an issue: https://github.com/cakephp/cakephp/issues/15466
# Apr 26th 2021, 09:26 noel The reason I think it is a bug is that the original association `$this->belongsTo(‘Notaries’, [‘className’ => ‘People’, ‘foreignKey’ => ‘notary_id’]); ` works if I add a `person_id` field to `enquiries` table. It shouldn’t need that, I don’t think.
# Apr 26th 2021, 09:22 slackebot @dereuromark @corey.taylor.fl?
# Apr 26th 2021, 09:22 noel It does do so if I don’t alias the foreignKey, so in other words if I do this: ```$this->belongsTo('Notaries', ['className' => 'People', 'foreignKey' => 'person_id']);``` Then it recognises the association and lists is in `PeopleTable->_associations` but it doesn’t work if I set a custom foreignKey. I think this might be a bug in the ORM but I’d like an expert opinion before I create an issue on GitHub @admad or
# Apr 26th 2021, 09:20 neon1024 Good point! That’s me out of ideas :)
# Apr 26th 2021, 09:19 noel So it should set this association on the PeopleTable, but it doesn’t.
# Apr 26th 2021, 09:19 noel from this: `className' => 'People'` – that’s what makes it an alias.
# Apr 26th 2021, 09:18 neon1024 As if ‘Notaries’ isn’t in the Registry, I wonder how Cake would know what table that it
# Apr 26th 2021, 09:17 neon1024 Although, I might be barking up the wrong tree!
# Apr 26th 2021, 09:17 neon1024 Might be worth looking in the TableRegistry to see what keys exist?
# Apr 26th 2021, 09:16 neon1024 Yep, probably. My brain was over here https://github.com/cakephp/cakephp/blob/3.9.9/src/ORM/Table.php#L240
# Apr 26th 2021, 09:15 noel ```$this->belongsTo('Notaries', ['className' => 'People', 'foreignKey' => 'notary_id']);```
# Apr 26th 2021, 09:14 noel As far as I can tell, that’s precisely what I’m doing.
# Apr 26th 2021, 09:14 neon1024 Just thinking you might want to alias People as Notaries :)