Log message #4210034

# At Username Text
# Oct 22nd 2019, 17:43 slackebot1 Cake\Http\Runner::handle() - CORE\src\Http\Runner.php, line 73 Cake\Http\Middleware\CsrfProtectionMiddleware::process() - CORE\src\Http\Middleware\CsrfProtectionMiddleware.php, line 123 Cake\Http\Runner::handle() - CORE\src\Http\Runner.php, line 73 ``` What's that all about?
# Oct 22nd 2019, 17:43 slackebot1 Cake\Http\ControllerFactory::create() - CORE\src\Http\ControllerFactory.php, line 50 Cake\Http\ActionDispatcher::dispatch() - CORE\src\Http\ActionDispatcher.php, line 61 Cake\Http\BaseApplication::handle() - CORE\src\Http\BaseApplication.php, line 206 Cake\Http\Runner::handle() - CORE\src\Http\Runner.php, line 77 Cake\Routing\Middleware\RoutingMiddleware::process() - CORE\src\Routing\Middleware\RoutingMiddleware.php, line 156
# Oct 22nd 2019, 17:43 slackebot1 Cake\ORM\Query::_all() - CORE\src\Datasource\QueryTrait.php, line 289 Cake\ORM\Query::all() - CORE\src\ORM\Query.php, line 1046 Cake\ORM\Query::first() - CORE\src\Datasource\QueryTrait.php, line 443 App\Controller\AppController::initialize() - APP/Controller\AppController.php, line 106 Cake\Controller\Controller::__construct() - CORE\src\Controller\Controller.php, line 212 ReflectionClass::newInstance() - [internal], line ??
# Oct 22nd 2019, 17:43 coreus Hmm, the FileEngine cacher is complaining with a notice after going from 4.0.0-beta3 to 4.0.0-beta4: ``` Notice (8): unserialize(): Error at offset 24 of 1206 bytes [CORE\src\Cache\Engine\FileEngine.php, line 201] Code Context unserialize - [internal], line ?? Cake\Cache\Engine\FileEngine::get() - CORE\src\Cache\Engine\FileEngine.php, line 201 Cake\Datasource\QueryCacher::fetch() - CORE\src\Datasource\QueryCacher.php, line 78
# Oct 22nd 2019, 17:40 johizzle @javier.villanueva try $user = $this->get($user_id, ['contain' => ['Groups']]); if that doesn't work, you can try creating the field in the form as groups._ids, it should work straight forward from there
# Oct 22nd 2019, 16:42 noel Must be routing I guess
# Oct 22nd 2019, 16:40 noel Hi guys. I'm bashing my head against something with crud-json-api. I have it working perfectly on one application but on the other (which is configured in the same way unless I'm missing something) when I send a post request to insert a new record it instead acts as if I've sent a GET request to fetch all records. Any idea what might be wrong?
# Oct 22nd 2019, 16:28 rochasmarcelo @daniel.upshaw have you followed https://github.com/CakeDC/users/blob/master/Docs/Documentation/Extending-the-Plugin.md?
# Oct 22nd 2019, 16:15 daniel.upshaw Anyone use `cakedc/users` and successfully extended the `UsersController`? https://github.com/CakeDC/users/issues/823
# Oct 22nd 2019, 14:16 dev.cyrusjayson got it
# Oct 22nd 2019, 14:10 dereuromark need to refactor IdeHelper to support all those new ide directives, pretty neat to have (method) argument autocomplete working now.
# Oct 22nd 2019, 14:09 dereuromark whuz up
# Oct 22nd 2019, 13:56 neon1024 No idea I’m afraid, I’ve never needed to use that
# Oct 22nd 2019, 13:56 dev.cyrusjayson Hey if I do this way, still okay? $this->con->execute("INSERT profiles (id)VALUES(?)",[$id]);
# Oct 22nd 2019, 13:52 neon1024 Oh, hey @dereuromark :wave:
# Oct 22nd 2019, 12:56 dereuromark You can, sure
# Oct 22nd 2019, 12:56 jotpe So i guess it should be fine to have it more specific.
# Oct 22nd 2019, 12:56 dereuromark In those cases best to ignore those then.
# Oct 22nd 2019, 12:55 jotpe It's a upload Behavior I use several times in my application.
# Oct 22nd 2019, 12:55 jotpe The IDeHelper CLI doesn't handle Behaviors
# Oct 22nd 2019, 12:55 dereuromark But for project level ones those are OK to have IMO.
# Oct 22nd 2019, 12:54 dereuromark I dont think my helper fixes behaviors yet. Usually, if you need this then the behavior is not as "agnostic" as behaviors usually are supposed to be.
# Oct 22nd 2019, 12:53 jotpe Hm
# Oct 22nd 2019, 12:50 dereuromark no this one: https://github.com/cakephp/bake/issues/456 and the linked ideHelper code
# Oct 22nd 2019, 12:47 jotpe THanks @dereuromark you mean this? https://github.com/dereuromark/cakephp-ide-helper/blob/master/src/Annotator/ModelAnnotator.php#L127
# Oct 22nd 2019, 12:38 dereuromark see also what Ide Helper here does for other callbacks in model code.
# Oct 22nd 2019, 12:37 dereuromark that works usually
# Oct 22nd 2019, 12:37 javier.villanueva @johizzle problem is that dont save the relationship in users_groups
# Oct 22nd 2019, 12:37 dereuromark to please phpstan you can set the concrete object into the docblock
# Oct 22nd 2019, 12:35 jotpe Is there a way to declare a property of a entity in a Behavior? F.e. I use this in my Behaviors `beforeSave()`: `$entity->storage_filename` PHPStan now says: `Access to an undefined property Cake\ORM\Entity::$storage_filename.` I set the storage_filename in `beforeMarshal()`
# Oct 22nd 2019, 12:32 johizzle $user->setDirty('groups', true); - you can try this
# Oct 22nd 2019, 12:26 javier.villanueva I use it, but always groups in user is [ ]
# Oct 22nd 2019, 12:25 javier.villanueva $data = []; $data['groups'] = $groups; $user = $this->get($user_id); $user = $this->patchEntity($user, $data); $this->save($user);
# Oct 22nd 2019, 12:17 javier.villanueva (is not a new entity)
# Oct 22nd 2019, 12:16 javier.villanueva I understand the simple association, but when there are multiple groups
# Oct 22nd 2019, 12:16 javier.villanueva I the https://book.cakephp.org/3.0/en/orm/saving-data.html#saving-belongstomany-associations example
# Oct 22nd 2019, 12:15 javier.villanueva I dont understand a simple way to save belongsToMany associations (for instance users_groups) having user_id and array with groups_ids. I have read the doc... but
# Oct 22nd 2019, 11:36 jotpe Thanks @ndm I did another find in the Table method. It's a bit hacked, because I already have that data in my user Identity but it works ...
# Oct 22nd 2019, 11:31 dev.cyrusjayson thanks
# Oct 22nd 2019, 11:16 neon1024 https://book.cakephp.org/3.0/en/orm/saving-data.html#inserting-data
# Oct 22nd 2019, 11:16 neon1024 Yeah, you could do that if you wanted to. I prefer working with Entities