Logs for #cakephp

Page 9 of 36,130, showing 100 records out of 3,612,917 total, starting on record 801, ending on 900

# At Username Text
# May 15th, 18:19 ricksaccous heh
# May 15th, 18:19 m.hoffs i `m not so expert
# May 15th, 18:19 ricksaccous well i was basically stopping cake from giving me json serializable magic and json views
# May 15th, 18:19 m.hoffs so i can search in my code
# May 15th, 18:19 m.hoffs with what command did u do that >
# May 15th, 18:19 m.hoffs hmmm
# May 15th, 18:18 ricksaccous i honestly don't really know but i've had a problem before where my viewClass was being set and it was not allowing another plugin to do it's thing
# May 15th, 18:18 m.hoffs by adding them manual to viewClassMap ?
# May 15th, 18:17 m.hoffs not that i know
# May 15th, 18:16 ricksaccous @m.hoffs are you setting a custom view class anywhere?
# May 15th, 18:11 m.hoffs but now see same problem with the cakepdf
# May 15th, 18:11 m.hoffs but that i sorted out different way, didnt pay attention on it
# May 15th, 18:11 m.hoffs and got simular problem with Csvview
# May 15th, 18:11 m.hoffs "viewClassMap" => array:5 [▼ "json" => "Json" "xml" => "Xml" "ajax" => "Ajax" "csv" => "CsvView.Csv" "pdf" => "CakePdf.Pdf"
# May 15th, 18:09 m.hoffs but my feeling its not getting to that class at all
# May 15th, 18:09 m.hoffs i can see in the request RequestHandler that the CakePdf class is loaded
# May 15th, 18:08 m.hoffs but its serving normal view
# May 15th, 18:08 m.hoffs so pthat part can confirm is working
# May 15th, 18:08 m.hoffs when i open the url, its forcing application/pdf
# May 15th, 18:08 m.hoffs added the router extension
# May 15th, 18:08 savant Sometimes people just aren’t around (lots of timezones in here) or busy with work :slightly_smiling_face:
# May 15th, 18:08 m.hoffs I installed the cakepdf plugin
# May 15th, 18:07 savant Whats the actual question?
# May 15th, 18:07 m.hoffs tried in morning and midday allready
# May 15th, 18:07 waspinator @m.hoffs just ask, and if someone has the time and knows how to help they will
# May 15th, 18:05 m.hoffs Anyone has a bit spare time to help me with debugging ?
# May 15th, 17:04 pedroseco any idea how could I get a list of all tables that my loaded plugins use?
# May 15th, 17:04 pedroseco Hi guys
# May 15th, 15:52 neon1024 :thumbsup:
# May 15th, 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, 15:25 neon1024 @ondrej.nedvidek If the controller extends it, just enable the action in that controllers `initialize` function
# May 15th, 15:24 neon1024 Boo!
# May 15th, 15:24 spriz @neon1024 there is nothing helpful in why-not, and deleting vendor did also not help :s
# May 15th, 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, 15:14 dereuromark haha, know the feeling
# May 15th, 15:12 neothermic I just tried to `./bin/cake` on my 2.x install :(
# May 15th, 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, 13:41 neon1024 Maybe `rm -rf vendor andand composer clearcache andand composer install` ?
# May 15th, 13:38 neon1024 `composer why-not intercom/intercom-php` ?
# May 15th, 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, 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, 13:34 admad you should be able to do what you want
# May 15th, 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, 13:26 m.hoffs Anyone has a bit spare time to help me with debugging ?
# May 15th, 13:16 admad so you need to dig into the marshaller and see why it does so :slightly_smiling_face:
# May 15th, 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, 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, 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, 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, 13:14 slackebot } ```
# May 15th, 13:07 dereuromark I need to manually Router::connect() everywhere
# May 15th, 12:57 dereuromark Still cant find my routes in the component test case
# May 15th, 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, 12:52 admad @waspinator show the debug of entity after calling `patchEntity()`
# May 15th, 12:39 waspinator so the relationship for user 2 being a `teacher` in this group is lost
# May 15th, 12:39 waspinator in the example, only the first is saved
# May 15th, 12:38 waspinator if the `id`s of the users are different it works
# May 15th, 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, 12:36 admad does your join table have primary key?
# May 15th, 12:35 admad `through` config is only for association setup, not patchEntity()
# May 15th, 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, 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, 12:30 admad @waspinator you would configure it in the association config
# May 15th, 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:
# May 15th, 12:29 waspinator it works fine otherwise. just not when two items have the same ids
# May 15th, 12:28 waspinator I have a through model, not sure what I need to configure for this specific case though.
# May 15th, 12:28 admad @waspinator have you configured the `through` model?
# May 15th, 12:24 waspinator how would I make `patchEntity` take `_joinData` into considerations when processing `belongsToMany` data? I want to add two relationships with the same `foreignKey` and `targetForeignKey`, but with different `_joinData`. In `beforeMarshal` I can see both items, but in `beforeSave` only the first one is there.
# May 15th, 12:21 spriz We resolved some issue with no routes in our test, but I see now that we solved it by moving to Routes middleware :S
# May 15th, 12:15 admad I have subscribed to that issue :(
# May 15th, 12:14 spriz and `<phpunit colors="true" bootstrap="./tests/bootstrap.php">` in your `phpunit.xml`?
# May 15th, 12:14 spriz You do have a `require $root . '/config/bootstrap.php';` in your `plugins/PluginName/tests/bootstrap.php` @dereuromark?
# May 15th, 12:13 spriz Done :slightly_smiling_face: https://github.com/rectorphp/rector/issues/1431
# May 15th, 12:08 dereuromark that one contains the RoutingMiddleware, but I am not sure how to invoke this fake Application.php class in TestApp/App namespace
# May 15th, 12:08 admad @spriz i would definitely open an issue in that case
# May 15th, 12:08 dereuromark Application in test_files is also not loaded right now.
# May 15th, 12:07 spriz Ah, so not in terms of how do you make the integration test cases pick up the routes @dereuromark? :P
# May 15th, 12:06 spriz not only in dry-run :)
# May 15th, 12:06 spriz @admad it actually does apply the change: https://gist.github.com/Spriz/93f0a79c9d1c5257713c2a783f1a0f1f
# May 15th, 12:05 dereuromark as entity->toArray() does recursive afaik
# May 15th, 12:05 dereuromark manually foreach ($features as $key => $feature) { $features[$key] = $feature->toArray(); } for all keys works for now
# May 15th, 12:03 spriz @dereuromark using middleware?
# May 15th, 12:02 dereuromark How can one get routes to work in plugin tests? I tried Router::reload(), doesnt seem to load my routes config file either.
# May 15th, 12:02 spriz I'll try and let it do it's thing
# May 15th, 12:02 spriz I only did `--dry-run`
# May 15th, 12:01 admad So is it actually changing calls to static methods or you just assumed it will do so?
# May 15th, 12:00 spriz Yeah I just saw that it should only do that for things thart are not static
# May 15th, 12:00 spriz Yeah it is https://github.com/rectorphp/rector/blob/master/packages/Php/src/Rector/StaticCall/StaticCallOnNonStaticToInstanceCallRector.php
# May 15th, 11:59 admad It shouldn't make changes for method which are declared as static
# May 15th, 11:59 admad @spriz this seems to be the rector in question https://github.com/rectorphp/rector/blob/master/docs/AllRectorsOverview.md#staticcallonnonstatictoinstancecallrector But the example shown is fine because the method isn't declared static.
# May 15th, 11:54 admad maybe it has a config to prevent such change?
# May 15th, 11:53 admad i would open an issue with rector to stop messing up the code for no reason
# May 15th, 11:52 spriz they change all `Foo::bar` to `(new Foo)->bar`
# May 15th, 11:52 admad that's silly
# May 15th, 11:52 spriz Yeah, but my concern is that the rector tool with php70, php71, php72 and php73 levels are changing that piece of code for some reason
# May 15th, 11:50 admad you shouldn't be doing `(new Text())->uuid()` infact, it's a static method
# May 15th, 11:49 admad @spriz static for utility functions are just fine
# May 15th, 11:49 Mikeynl ok, anyone can point me out where to get some help on my question ?
# May 15th, 11:47 dereuromark @neothermic I kind of hoped to get a more toArrayRecursive() kind of thing here somehow.
# May 15th, 11:44 spriz Those 2 appear the same to me, just with a different syntax with harder-to-read use of parentheses