Logs for #cakephp

Page 7 of 36,247, showing 100 records out of 3,624,625 total, starting on record 601, ending on 700

# At Username Text
# Aug 16th, 09:04 admad @koeller by calling $next() first you are setting up the alias after your controller code already run :)
# Aug 16th, 08:44 koeller I would like to set a database connection through this TenantShardMiddleware. I added `$middleware->add(TenantShardMiddleware::class)` to my Application.php. When I debug the code the Middleware class is loaded correctly, but the ConnectionManager::alias won’t take any effect and my Table will always use the default database credentials. Any ideas? Thank you!
# Aug 16th, 07:26 conehead Good morning
# Aug 16th, 07:26 jotpe Hi
# Aug 16th, 02:49 D-rex it didnt solve errors just created more
# Aug 16th, 02:49 D-rex @challgren it wasn't but I did it anyway. I'm not sure why I would need to install it though if I haven't configured anything to use it
# Aug 16th, 02:33 kiwi_58 sdsd
# Aug 16th, 01:13 jslamka5685 The ObjectType database type was exactly what I needed.
# Aug 16th, 01:12 jslamka5685 @dereuromark Took me some time to figure out exactly what I needed to do, but your solution is top notch.
# Aug 15th, 23:11 dereuromark see geo plugin, it uses the same thing
# Aug 15th, 23:10 jslamka5685 How do I go about including a virtual field within a pagination query?
# Aug 15th, 20:13 latenal @admad, it worked! Thanks
# Aug 15th, 20:11 admad same for `Date`
# Aug 15th, 20:11 admad @latenal add `FrozenDate::setJsonEncodeFormat('yyyy-MM-dd')` in bootstrap
# Aug 15th, 20:04 latenal yes
# Aug 15th, 20:03 ricksaccous are you using _serialize?
# Aug 15th, 20:01 latenal Hi, how do I change date format in a json output? I have `index` method that returns dates like this “2019-08-15T00:00:00+00:00”. I would like to remove the time part (in the database this field is DATE not DATETIME)
# Aug 15th, 18:52 jotpe thanks
# Aug 15th, 18:52 jotpe :shuffleparrot:drives me crazy
# Aug 15th, 18:50 ricksaccous it's not using the actual roles table class when you do that though
# Aug 15th, 18:50 challgren did you try find()->where([])->contain()
# Aug 15th, 18:50 ricksaccous yeah because it uses magic
# Aug 15th, 18:50 jotpe o.O
# Aug 15th, 18:50 jotpe Without the contain the find is working without plugin prefix
# Aug 15th, 18:49 ricksaccous oh yeah lol
# Aug 15th, 18:49 ndm I never liked these magic tables
# Aug 15th, 18:49 jotpe Ty :slightly_smiling_face:
# Aug 15th, 18:48 jotpe I know it's gonna hurt @ndm
# Aug 15th, 18:46 ndm @jotpe `->get('Users.Users')`
# Aug 15th, 18:44 jotpe got the same error @ricksaccous
# Aug 15th, 18:43 mrfeedback how to handle massassignments with Authorization plugin? `$collectionparts = $this->Collectionparts->patchEntities($collectionparts,$data); $this->Authorization->can($collectionparts,'update'); ` throws an error ` Error: [Authorization\Policy\Exception\MissingPolicyException] Policy for 'array' has not been defined.`
# Aug 15th, 18:43 slackebot <jotpe>
# Aug 15th, 18:43 slackebot <jotpe>
# Aug 15th, 18:37 jotpe So with a through model you mean create the mdel classes for roles_users?
# Aug 15th, 18:34 ricksaccous and creating that middle man model
# Aug 15th, 18:34 ricksaccous i always like using the through or whatever the option is called though
# Aug 15th, 18:33 ricksaccous so that's why i wanted to see if there's something wrong in your association config there that's breaking things
# Aug 15th, 18:33 ricksaccous it will just assume the join table, and you're following conventions
# Aug 15th, 18:33 jotpe actually it#s a bit strange. it uses mostly the same config as the CMS tutorial: https://book.cakephp.org/3.0/en/quickstart.html#cms-tutorial-creating-the-database
# Aug 15th, 18:32 jotpe just the classname shouldn't work...it uses the join table
# Aug 15th, 18:30 ricksaccous if that doesn't work then maybe create a through model and use the through option as well
# Aug 15th, 18:29 ricksaccous wait a minute
# Aug 15th, 18:29 ricksaccous other configs...
# Aug 15th, 18:29 ricksaccous does it work?
# Aug 15th, 18:29 ricksaccous if you try it with just className defined and take out the other ones from the association config
# Aug 15th, 18:26 jotpe It's in the samee plugin called Users
# Aug 15th, 18:26 challgren Are you using a plugin for your Roles?
# Aug 15th, 18:26 jotpe `$this->belongsToMany('Roles', [ 'foreignKey' => 'user_id', 'targetForeignKey' => 'role_id', 'joinTable' => 'roles_users', 'className' => 'Users.Roles' ]);`
# Aug 15th, 18:26 jotpe My UsersTable has this association:
# Aug 15th, 18:25 jotpe I know, it's a silly question, but i don't get the error. I have 3 tables (users, roles and roles_users). roles_users as a join table contains user_id/role_id which has fk to the corresponding table. When i do: `$usersTable = TableRegistry::getTableLocator()->get('Users'); $users = $usersTable->find('all', ['contain' => ['Roles']]);` I get _The Roles association is not defined on Users._
# Aug 15th, 15:25 neon1024 @ndm Thank you for your help. I’ve managed to get my Ajax working *with* the Csrf middleware. In my bluster and confusion I had failed to realize that I needed to call `$this->Form->secure()` and use the values output by that method to pass as my `_Token` data. Thanks again :thumbsup:
# Aug 15th, 15:22 ricksaccous np
# Aug 15th, 15:22 scuadra thank you for the help
# Aug 15th, 15:22 scuadra ok, so I'll try to use it twice and hope it works :slightly_smiling_face:
# Aug 15th, 15:21 ricksaccous yeah you're right, that's what i was saying, that's fine
# Aug 15th, 15:19 scuadra I suggest that I can't see if there are any errors without calling patchEntity :face_with_rolling_eyes:
# Aug 15th, 15:18 ricksaccous meh, whatever that sounds fine
# Aug 15th, 15:17 ricksaccous but that might not be helpful because you can't check for errors there
# Aug 15th, 15:17 ricksaccous you could add the associated data in beforeMarshall possibly
# Aug 15th, 15:16 scuadra I am not sure if I explained what I want to do :
# Aug 15th, 15:16 scuadra What I want to achieve is call patchEntity() to see if there are errors in validation, then I want to do some calculations and based on them to change some fields in the request data and to add some associated data and finally I want to save()
# Aug 15th, 15:13 ricksaccous @scuadra not necessarily but i don't see why you woul.. yep
# Aug 15th, 15:13 steinkel @scuadra I don't see a problem, maybe merge all the data first and call pathEntity once?
# Aug 15th, 15:12 steinkel np
# Aug 15th, 15:12 skor second time this happened to me :slightly_smiling_face:
# Aug 15th, 15:12 skor just got there myself, thanks @steinkel :face_palm:
# Aug 15th, 15:11 steinkel @skor you have `$this->_associations->remove('X');`
# Aug 15th, 15:11 skor ok, i see that AssociationCollection has the remove, oops
# Aug 15th, 15:09 scuadra Hello. In Cake 3 is it wrong if I use patchEntity() 2 times before calling save() ?
# Aug 15th, 15:07 steinkel @neon1024 you don't need to put middlewares in routes if you don't want to, you can keep all in your Application but you'll need to add some logic to bypass the middleware based on routing params possibly, which is ugly
# Aug 15th, 15:07 skor issue is the default assoc is adding a condition on the join, and i dont need it
# Aug 15th, 15:06 skor i see there is a Table::addAssociations but no remove, so if i have a predefined assoc, i cant remove it at runtime?
# Aug 15th, 15:05 ricksaccous alright have a good break
# Aug 15th, 15:05 ricksaccous @neon1024 how is it a black box when it's open source? lolll
# Aug 15th, 15:05 neon1024 Rant over, gonna take a break.
# Aug 15th, 15:05 skor hello everyone! how can i remove an association in cake 3? cant find the method
# Aug 15th, 15:05 ricksaccous whatever framework/language you use is just a tool to solve a problem
# Aug 15th, 15:05 neon1024 They described Cake as a black box which you pulled a lever and something else happened somewhere else
# Aug 15th, 15:04 ricksaccous but it's annoying
# Aug 15th, 15:04 ricksaccous i don't understand all this holier than though stuff among programmers, well i suppose I do
# Aug 15th, 15:04 neon1024 Yep, by some eejit
# Aug 15th, 15:04 ricksaccous you were ridiculed at a conference for using cake?
# Aug 15th, 15:04 ricksaccous lol
# Aug 15th, 15:04 neon1024 It’s horrible and it’s choices like that which drive that opinion
# Aug 15th, 15:04 neon1024 If you’ve ever been personally ridiculed at a conference for using CakePHP you’ll know what I mean
# Aug 15th, 15:03 neon1024 Which I’d love to dispel, but I just can’t
# Aug 15th, 15:03 neon1024 Plus the whole magic thing is an age old critisim of Cake generally
# Aug 15th, 15:03 ricksaccous i'm just pulling your leg
# Aug 15th, 15:03 neon1024 Putting middleware in the routes when the other middleware is in Application.php is misleading
# Aug 15th, 15:03 neon1024 I want ease of installation with an api which is descriptive
# Aug 15th, 15:03 neon1024 I don’t want ease of use
# Aug 15th, 15:02 ricksaccous > wants ease of use >dislikes magic hmmmm
# Aug 15th, 15:02 neon1024 Would not _Token again
# Aug 15th, 15:02 neon1024 Needs work C-
# Aug 15th, 15:02 neon1024 If I can’t get it to work in a few hours, then, to me, it’s not worth using
# Aug 15th, 15:01 neon1024 It’s clearly not easy enough to use yet
# Aug 15th, 15:01 neon1024 I think I’m going to cut my losses and turn off the csrf
# Aug 15th, 14:59 ricksaccous oh supreme wizard guide cake to magical glory
# Aug 15th, 14:57 neon1024 We’re supposed to be getting rid of the magic
# Aug 15th, 14:57 neon1024 I do not like this.