Logs for #cakephp

Page 1 of 36,241, showing 100 records out of 3,624,077 total, starting on record 1, ending on 100

# At Username Text
# Yesterday, 17:24 mrfeedback how should I 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.`
# Yesterday, 06:14 NickFuryBR Hey guys, I'm having troubles to save a hasmany relationship using the Proffer :( may anyone help me?
# Yesterday, 02:18 ggrecu059 Hope others can benefit from this :slightly_smiling_face:
# Yesterday, 02:18 ggrecu059 I finally found out why i was getting a 404. In my apache config i had MultiViews enabled Apache website, the effect of Multiviews, as listed under Content Negotiation, is as follows: > If the server receives a request for /some/dir/foo, if /some/dir has MultiViews enabled, and /some/dir/foo does not exist, then the server reads the directory looking for files named foo.*, and effectively fakes up a type map which names all those files,
# Yesterday, 02:18 slackebot assigning them the same media types and content-encodings it would have if the client had asked for one of them by name. It then chooses the best match to the client's requirements.
# Yesterday, 02:18 ggrecu059 Ok i figured it out :partyparrot:
# Yesterday, 01:59 sphereweb Good evening
# Yesterday, 01:52 ggrecu059 Hello fellow Cake enthusiasts. I have a quick question. I have tried for hours to find out why i cannot make a route for the `https://domain.com/robots.txt` using the following code `Router::connect('/robots', array('controller' => 'pages','action' => 'robots', 'ext' => 'txt'));` It keeps giving me a 404, but its like the Apache 404. Seems like its not going to Cake .. any ideas?
# Yesterday, 01:20 Ayz4 hello !!
# Aug 16th, 21:11 maymeow but its working now ;)
# Aug 16th, 21:10 maymeow thank you @ndm but in `3.7.*` i have to use ``` $conn = ConnectionManager::getConfig('default'); if ($conn['driver'] == Sqlserver::class) { ```
# Aug 16th, 21:06 ndm Obtain an instance of the connection, and either check its configuration, or the driver instance, like: `\Cake\Datasource\ConnectionManager::get('default')->config()` or `\Cake\Datasource\ConnectionManager::get('default')->getDriver()`
# Aug 16th, 21:03 maymeow @ndm im using default connection as standard in whole application
# Aug 16th, 21:02 ndm @maymeow "currently used database driver" is rather ambigous, as repositories can use different connections (and therefore different drivers). Your example looks like you want to know which driver a specific connection is using?
# Aug 16th, 20:57 ndm @etipaced Sounds like the saner approach for now, if you just need some additional data for an existing dataset.
# Aug 16th, 20:55 maymeow how can i get currently used database driver in controller ? `Configure::read('Datasourceds.default.driver')` is returning null
# Aug 16th, 20:32 etipaced @ndm I was back and forth on the 2 approaches. I think a result formatter is all I need for now as this is a basic key => val dataset that’s coming back to me. I did start playing with the creation of a custom `Driver` object, but I’m thinking that is only the tip of the torture.
# Aug 16th, 20:27 ndm But if you really want to go off of the deep end, maybe start with looking into using custom association and loader classes.
# Aug 16th, 20:26 ndm Unless you really, reeeeeealy need such a transparent solution, I'd probably consider something more basic first, like a result formatter that queries the other datasource merges the data into the result set.
# Aug 16th, 20:25 ndm @etipaced You want to combine different datasources under the common ORM interface? Oh boy, be prepared for a world of pain, suffering, and outright unfathomable agony :relaxed:
# Aug 16th, 20:05 etipaced This table would be used in a `belongsTo` relationship with a MySQL-backed `Table` (having the converse `hasMany`, of course).
# Aug 16th, 20:04 etipaced What would be the correct approach to creating a table that has a JSON API as its data source (no database, iow)?
# Aug 16th, 19:29 davorminchorov Ok will check it out, thanks!
# Aug 16th, 16:25 dereuromark @davorminchorov 3.7/3.8 became a bit more strict in handling invalid input types, see migration guides
# Aug 16th, 15:43 jortega it looks pretty similar
# Aug 16th, 15:43 jortega Hi, it is a thread at stackoverflow https://stackoverflow.com/questions/40110318/cannot-convert-value-to-string-when-retrieving-data-belongstomany-relationshi maybe it could helo you
# Aug 16th, 15:39 davorminchorov Anyone here ever got the following error when saving data with the Entity object? `Cannot convert value of type `string` to integer` It's weird that it throws such an error when the database field and the field are strings, not integers
# Aug 16th, 15:10 neon1024 Anyway, job for Monday. Have a great weekend everyone :wave:
# Aug 16th, 15:09 neon1024 Perhaps I’ll have to build something
# Aug 16th, 15:08 neon1024 Although it doesn’t enforce workflow, but just adds api sugar
# Aug 16th, 15:08 neon1024 I think I’m looking for this actually :point_right: https://github.com/cakemanager/cakephp-utils/wiki/stateable
# Aug 16th, 15:07 neon1024 Don’t fancy doing that!
# Aug 16th, 15:06 val @neon1024 You can try to migrate it :slightly_smiling_face:
# Aug 16th, 15:03 neon1024 `3.8.2` :slightly_smiling_face:
# Aug 16th, 15:03 neon1024 Sorry, forgot to mention the version!
# Aug 16th, 15:02 neon1024 I’m on 3.x :slightly_smiling_face:
# Aug 16th, 15:02 val @neon1024 https://github.com/bancer/cakephp-wizard for 2.x
# Aug 16th, 15:00 neon1024 My app needs some workflows :slightly_smiling_face:
# Aug 16th, 14:51 spriz I saw some talking a while ago with some immutable transform actions
# Aug 16th, 14:11 neon1024 Did someone have a plugin which was around working with stepped processes? Such as moving an order from basket, pending, paid, shipped, completed, etc? Like a workflow
# Aug 16th, 13:42 CakeBegginer can you guys help me where am I wrong
# Aug 16th, 13:41 CakeBegginer Hello guys, I'm stuck into an Issue, i have created a website with cakePHP and it is working well with localhost, but when I've uploaded it on server it is not, and showing me en error of "misconfiguration",
# Aug 16th, 13:24 neon1024 Good question for cakefest
# Aug 16th, 12:31 challgren I wish I could go but it would cost an arm and a leg for me is it going to web streamed at all?
# Aug 16th, 09:35 alexdd55976 i would so love to come to cakefest. first of all to meet you guys personally, also the topics are very interesting
# Aug 16th, 09:18 hmic s/ens/ions/
# Aug 16th, 09:17 hmic I am happy for suggestens before I decide to go ;-)
# Aug 16th, 09:17 neon1024 @hmic I have a hotel near Shinjuku-Gyoemmae subway station
# Aug 16th, 09:16 neon1024 Morning team! :wave:
# Aug 16th, 09:09 hmic Where are zou guys staying?
# Aug 16th, 09:09 koeller @admad thanks alot. works now :slightly_smiling_face:
# Aug 16th, 09:09 hmic ah, guys... I just thought about joining cakefest this time...
# 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' ]);`