Log message #4186458

# At Username Text
# May 15th 2019, 18:07 m.hoffs tried in morning and midday allready
# May 15th 2019, 18:07 waspinator @m.hoffs just ask, and if someone has the time and knows how to help they will
# May 15th 2019, 18:05 m.hoffs Anyone has a bit spare time to help me with debugging ?
# May 15th 2019, 17:04 pedroseco any idea how could I get a list of all tables that my loaded plugins use?
# May 15th 2019, 17:04 pedroseco Hi guys
# May 15th 2019, 15:52 neon1024 :thumbsup:
# May 15th 2019, 15:42 ondrej.nedvidek thanks @neon1024.. I needed mapping, but you gave me lead .. and after more searching I found it https://crud.readthedocs.io/en/latest/configuration.html#action-configuration so classic RTFM-properly situation ..
# May 15th 2019, 15:25 neon1024 @ondrej.nedvidek If the controller extends it, just enable the action in that controllers `initialize` function
# May 15th 2019, 15:24 neon1024 Boo!
# May 15th 2019, 15:24 spriz @neon1024 there is nothing helpful in why-not, and deleting vendor did also not help :s
# May 15th 2019, 15:19 ondrej.nedvidek CRUD problem: I need to map the action on the fly. I inherit controller but one action I need is missing in parent. thanks for any hint/help ;)
# May 15th 2019, 15:14 dereuromark haha, know the feeling
# May 15th 2019, 15:12 neothermic I just tried to `./bin/cake` on my 2.x install :(
# May 15th 2019, 14:42 Fanzy Hi all. I need to change the default date formats for italian, french and german languages in my application. Is there any way to set it in bootstrap.php / application.php? I'm on Cake 3.7
# May 15th 2019, 13:41 neon1024 Maybe `rm -rf vendor andand composer clearcache andand composer install` ?
# May 15th 2019, 13:38 neon1024 `composer why-not intercom/intercom-php` ?
# May 15th 2019, 13:36 spriz `intercom/intercom-php:^4.0.0 php-http/guzzle6-adapter` is no problem - but `intercom/intercom-php:^4.0.2 php-http/guzzle6-adapter` suddenly is :thinking_face:
# May 15th 2019, 13:34 spriz I know this is a composer-related question and not cake, but I guess this is a piece of cake for someone but me - can someone explain me why composer is getting to the concluison to install v1.1.0 out of (seemingly) nowhere?! :) https://gist.github.com/Spriz/54801e1e9e29d5a7340263f372c3fab0
# May 15th 2019, 13:34 admad you should be able to do what you want
# May 15th 2019, 13:28 waspinator @admad so this is expected behavior, and I should be able to do what I want by understanding https://github.com/cakephp/cakephp/blob/master/src/ORM/Marshaller.php ?
# May 15th 2019, 13:26 m.hoffs Anyone has a bit spare time to help me with debugging ?
# May 15th 2019, 13:16 admad so you need to dig into the marshaller and see why it does so :slightly_smiling_face:
# May 15th 2019, 13:15 waspinator but only if the ids are the same. If I add two different users to the group it works as expected, saving the join data as well
# May 15th 2019, 13:14 slackebot } ```
# May 15th 2019, 13:14 slackebot => [], '[repository]' => 'Users' } ], '[new]' => false, '[accessible]' => [ 'name' => true, 'users' => true ], '[dirty]' => [ 'users' => true, 'modified' => true ], '[original]' => [ 'modified' => object(Cake\I18n\FrozenTime) { 'time' => '2019-05-15T12:19:14+00:00', 'timezone' => 'UTC', 'fixedNowTime' => false } ], '[hasErrors]' => false, '[errors]' => [], '[invalid]' => [], '[repository]' => 'UserGroups'
# May 15th 2019, 13:14 slackebot '[virtual]' => [], '[hasErrors]' => false, '[errors]' => [], '[invalid]' => [], '[repository]' => 'UserGroupsUsers' }, '[new]' => false, '[accessible]' => [ 'username' => true, 'user_groups' => true, '_joinData' => true ], '[dirty]' => [ '_joinData' => true ], '[original]' => [ '_joinData' => [ 'role' => 'student' ] ], '[hasErrors]' => false, '[errors]' => [], '[invalid]'
# May 15th 2019, 13:14 waspinator @admad it ignores the second association ``` object(App\Model\Entity\UserGroup) { 'id' => (int) 1, 'name' => 'test', 'users' => [ (int) 0 => object(App\Model\Entity\User) { 'id' => (int) 2, 'username' => 'test', '_joinData' => object(Cake\ORM\Entity) { 'role' => 'student', '[new]' => true, '[accessible]' => [ '*' => true ], '[dirty]' => [ 'role' => true ], '[original]' => [],
# May 15th 2019, 13:07 dereuromark I need to manually Router::connect() everywhere
# May 15th 2019, 12:57 dereuromark Still cant find my routes in the component test case
# May 15th 2019, 12:57 dereuromark @spriz Nope, I got those and doesnt work. I even manually loaded routes.php file and did Router::reload() before that one.
# May 15th 2019, 12:52 admad @waspinator show the debug of entity after calling `patchEntity()`
# May 15th 2019, 12:39 waspinator so the relationship for user 2 being a `teacher` in this group is lost
# May 15th 2019, 12:39 waspinator in the example, only the first is saved
# May 15th 2019, 12:38 waspinator if the `id`s of the users are different it works
# May 15th 2019, 12:38 waspinator yes, it has a primary key. it works most of the time, but not for a case where the ids are the same. For example, adding the same user to a user group but with different roles ``` object(ArrayObject) { name => 'test' users => [ (int) 0 => [ 'id' => (int) 2, '_joinData' => [ 'role' => 'student' ] ], (int) 1 => [ 'id' => (int) 2, '_joinData' => [ 'role' => 'teacher' ] ] ] } ```
# May 15th 2019, 12:36 admad does your join table have primary key?
# May 15th 2019, 12:35 admad `through` config is only for association setup, not patchEntity()
# May 15th 2019, 12:34 slackebot $this->belongsToMany('Students', [ 'through' => 'CoursesMemberships', ]); } } class CoursesMembershipsTable extends Table { public function initialize(array $config) { $this->belongsTo('Students'); $this->belongsTo('Courses'); } } ```
# May 15th 2019, 12:34 waspinator @admad so that would be in the `through` table or as the third parameter of `patchEntity()`? I pretty much have this table setup ``` class StudentsTable extends Table { public function initialize(array $config) { $this->belongsToMany('Courses', [ 'through' => 'CoursesMemberships', ]); } } class CoursesTable extends Table { public function initialize(array $config) {
# May 15th 2019, 12:30 admad @waspinator you would configure it in the association config
# May 15th 2019, 12:29 spriz Besides that, last time we had issues with routes and plugins we had missed something when doing https://book.cakephp.org/3.0/en/development/application.html#adding-the-new-http-stack-to-an-existing-application, and moved some things around between `webroot/index.php`, `config/bootstrap.php` and `src/Application` so maybe double check that list @dereuromark:slightly_smiling_face: