Logs for #cakephp

Page 3 of 36,389, showing 100 records out of 3,638,823 total, starting on record 201, ending on 300

# At Username Text
# Nov 14th, 13:27 scuadra Hello. I have the following issue. I am using this plugin (https://github.com/UseMuffin/Slug) to create slug for my products. But I want to use both `id` and `title` as `displayField`. Since the `id` field is not present when the slug is build I got an error and cannot save my records. Is it possible somehow to make this work or I should remove `id` from `displayField`?
# Nov 14th, 12:50 frank @rk.thedigifrog What @admad said
# Nov 14th, 12:31 pieceof id remove parenthesis from where
# Nov 14th, 12:29 admad you might have whitespace in the saved value
# Nov 14th, 12:28 pieceof try like ?
# Nov 14th, 12:12 rk.thedigifrog @frank ^
# Nov 14th, 12:09 rk.thedigifrog Not working means query is not working even if I hit same query in MYSQL console
# Nov 14th, 12:08 rk.thedigifrog Expected result:
# Nov 14th, 12:07 frank @rk.thedigifrog Not working..? What’s happening and what were you expecting to happen?
# Nov 14th, 12:05 javier.villanueva thanks @dereuromark
# Nov 14th, 12:02 rk.thedigifrog Hi Guy's, cakephp query not working: $this->Messages->find()->contain(['Campaigns'=>['campaignResponses']])->where(['Messages.sent_from '=> $get_array['To'], 'Messages.sent_to '=> $get_array['From']])->order(['Messages.created' => 'DESC'])->first(); Raw Query in log: SELECT Messages.id AS `Messages__id`, Messages.campaign_id AS `Messages__campaign_id`, Messages.customer_id AS `Messages__customer_id`, Messages.messageSid AS
# Nov 14th, 12:02 slackebot1 `Messages__messageSid`, Messages.message_sent AS `Messages__message_sent`, Messages.sent_from AS `Messages__sent_from`, Messages.sent_to AS `Messages__sent_to`, Messages.delivery_status AS `Messages__delivery_status`, Messages.created AS `Messages__created`, Messages.modified AS `Messages__modified`, Campaigns.id AS `Campaigns__id`, Campaigns.title AS `Campaigns__title`, Campaigns.user_id AS `Campaigns__user_id`, Campaigns.start_date AS
# Nov 14th, 12:02 slackebot1 `Campaigns__start_date`, Campaigns.template AS `Campaigns__template`, Campaigns.company_id AS `Campaigns__company_id`, Campaigns.status AS `Campaigns__status`, Campaigns.message_time AS `Campaigns__message_time`, Campaigns.day_of_week AS `Campaigns__day_of_week`, Campaigns.messages_limit AS `Campaigns__messages_limit`, Campaigns.offer_code AS `Campaigns__offer_code`, Campaigns.is_deleted AS `Campaigns__is_deleted`, Campaigns.created AS
# Nov 14th, 12:02 slackebot1 `Campaigns__created`, Campaigns.modified AS `Campaigns__modified` FROM messages Messages LEFT JOIN campaigns Campaigns ON Campaigns.id = (Messages.campaign_id) WHERE (Messages.sent_from = '+15104221247' AND Messages.sent_to = '+14242576491') ORDER BY Messages.created DESC LIMIT 1
# Nov 14th, 11:07 dereuromark if you modify courses in loop, then student entitiy doesnt know that. that is the case where you have to manually $student->setDirty('courses') then for the ORM to know
# Nov 14th, 10:57 javier.villanueva problem is that I dont know assign this days_attended. ¿Where I must assign?, in course? in student? in other?
# Nov 14th, 10:56 javier.villanueva if I do foreach $courses . $course->days_attended. Then I have a dirty field days_attended in dd($student)
# Nov 14th, 10:54 dereuromark in some cases you need to manually setDirty() those. but shouldnt be the case for direct assignment here
# Nov 14th, 10:54 dereuromark check why the fields are not dirty after you set them
# Nov 14th, 10:48 javier.villanueva not really, but I can do it
# Nov 14th, 10:48 dereuromark no need to validate the info?
# Nov 14th, 10:48 dereuromark why are you not patching it?
# Nov 14th, 10:47 javier.villanueva cause I dont see nothing
# Nov 14th, 10:47 javier.villanueva then I have a mistake lol
# Nov 14th, 10:44 javier.villanueva yes $student sorry
# Nov 14th, 10:44 dereuromark dd() the result and you will see
# Nov 14th, 10:43 dereuromark and yes, you can directly modify fields
# Nov 14th, 10:43 dereuromark $student (singular)
# Nov 14th, 10:42 javier.villanueva ``` $students = $this->Students->newEntity(); $students->courses = $courses; ¿and days_attended? ```
# Nov 14th, 10:41 javier.villanueva if I have a belongsToMany (with through option cause I have metadata in this relation https://book.cakephp.org/3/en/orm/associations.html#using-the-through-option). Could I save this metadata infomation directly when I save one of the models? for instance In the doc example how to save days_attended
# Nov 14th, 10:39 javier.villanueva morning all
# Nov 14th, 10:34 challgren Im not sure, I never use deliver I always do ->send()
# Nov 14th, 10:32 mehov you mean it should use the *default transport*, not the whatever transport defined for the *default profile*, correct? i.e. this is the intended behaviour, and if i want `deliver()` to use my custom transport configuration, i should overwrite the default transport with it, instead of putting it into a separate transport and choosing it for the default profile
# Nov 14th, 10:29 challgren But it should use the default
# Nov 14th, 10:28 challgren Source code
# Nov 14th, 10:28 challgren https://api.cakephp.org/3.4/source-class-Cake.Mailer.Email.html#2092-2130
# Nov 14th, 10:27 mehov https://cakesf.slack.com/archives/C053DPNGT/p1573727141287500 > Sounds like deliver specifies you must define the config does it say that in the doc or source code somewhere?
# Nov 14th, 10:26 mehov I sat down to read the Email doc page and found it there: https://book.cakephp.org/3/en/core-libraries/email.html#sending-messages-quickly The logic made sense: > Sometimes you need a quick way to fire off an email, and you don’t necessarily want do setup a bunch of configuration ahead of time. Cake\Mailer\Email::deliver() is intended for that purpose It's just having to setup configuration for the method that's supposed to work quickly
# Nov 14th, 10:26 slackebot1 breaks the whole point
# Nov 14th, 10:25 challgren Sounds like deliver specifies you must define the config
# Nov 14th, 10:24 challgren @mehov I’ve never seen Email::deliver() used. Most of the time it should be Email->send()
# Nov 14th, 10:23 slackebot1 time (thinking that's what the config files are for, right?)
# Nov 14th, 10:23 mehov hi everyone, `\Cake\Mailer\Email::deliver($to, $subject, $message)` ignores the from and transport settings defined in `config/app.php` under the `default` profile. Is that the intended behaviour? When I call the basic way, the settings get picked up just fine ``` $email = new \Cake\Mailer\Email(); $email ->setTo($to) ->setSubject($subject) ->send($message); ``` Here are the settings under `config/app.php`: ``` 'Email' => [
# Nov 14th, 10:23 slackebot1 'default' => [ 'transport' => 'my-transport-name', 'from' => 'support@example.com', ], ], ``` If I explicitly define the from and transport inside `deliver()`, it works just fine. ``` \Cake\Mailer\Email::deliver($to, $subject, $message, [ 'from' => 'support@example.com', 'transport' => 'aws-ses', ]); ``` But I'd want to avoid having to specify the configuration every
# Nov 14th, 10:20 jotpe Then check the encoding: https://superuser.com/questions/1187374/check-the-character-encoding-of-a-given-page-in-chrome
# Nov 14th, 10:18 BOSS75 it shows box in some version of chrome
# Nov 14th, 10:18 BOSS75 it works in updated browser
# Nov 14th, 10:18 challgren Funny thing in slack they show up as boxes
# Nov 14th, 10:18 jotpe Which browser do you use?
# Nov 14th, 10:17 jotpe BOSS75: This works for me in Chrome 78 and Firefox 70: $this->set('test', '⮂');
# Nov 14th, 10:11 conehead yeh, quiet now before he starts raging again :)
# Nov 14th, 10:08 BOSS75 no sent as ⮂ .
# Nov 14th, 10:04 BOSS75 okay
# Nov 14th, 10:04 challgren isnt sent as UTF8
# Nov 14th, 10:04 challgren Sounds like the browser doesn’t support UTF8 or the page isn’
# Nov 14th, 10:03 challgren No worries plus admad become a mad :P
# Nov 14th, 10:03 jotpe sounds like an encoding error? Do you use UTF8 everywhere (PHP Files, Webserver, DB, HTML, Browser?)
# Nov 14th, 10:02 jotpe thanks @challgren
# Nov 14th, 10:02 challgren FYI IRC users can’t see threads
# Nov 14th, 10:02 jotpe sounds like an encoding error? Do you use UTF8 everywhere (PHP Files, Webserver, DB, HTML, Browser?)
# Nov 14th, 10:00 jotpe Morning
# Nov 14th, 09:58 BOSS75 I am sending data ($symbol = '⮂';) from controller . in my view how show that . In some browser it shows rectangle and some browser shows perfectly.
# Nov 14th, 09:40 angelxmoreno thanks for steering me in the right direction
# Nov 14th, 09:40 angelxmoreno that is where the JWT construction should exist since once authenticated by any means, the JWT can be accessible via the getIdentity function in the Authentication component
# Nov 14th, 09:39 angelxmoreno the Identity class is basically a decorator for whatever the resolvers produce
# Nov 14th, 09:38 angelxmoreno @ndm fyi, the solution was to add the JWT encoding to a custom Identity class. I was confusing Identifiers with the Identity classes. I also got rid of the ApiAuthenticator that previously extended the FormAuthenticator to return a JWT. Now, any authenticator that produces an Identity has access to the JWT
# Nov 14th, 09:33 conehead BOSS75...I answered you...
# Nov 14th, 09:33 scuadra thank you very much
# Nov 14th, 09:33 scuadra all right
# Nov 14th, 09:33 dereuromark jep
# Nov 14th, 09:32 scuadra @dereuromark so I should do something like: `->add('start_date', 'checkDates', [ 'rule' => function ($value, $context) { //check go here }, 'message' => 'Invalid start date', 'on' => 'create' ])`
# Nov 14th, 09:27 BOSS75 I need help ... regarding unicode
# Nov 14th, 09:23 dereuromark @scuadra Did you read the docs here? on create/update?
# Nov 14th, 09:23 jeremy.halin Hi, I'm doing a complex SQL query with `$connection->execute('SELECT * FROM orders')->fetchAll('assoc');`, is it possible to hydrate entities with the resulting data ? Thanks.
# Nov 14th, 09:21 BOSS75 Hello anyone here ??
# Nov 14th, 09:21 scuadra One more question. When I parse the dates in `beforeMarshal()` I want to add my custom rules to check if everything is OK (start_date is before end_date and some other checks). But is it possible to specify these checks to be triggered only on create? :face_with_rolling_eyes:
# Nov 14th, 09:18 BOSS75 ??
# Nov 14th, 09:16 scuadra @conehead thank you. :slightly_smiling_face:
# Nov 14th, 09:12 conehead More input needed
# Nov 14th, 08:59 BOSS75 How to achieve it perfectly in view??
# Nov 14th, 08:59 BOSS75 But in clients browser it shows rectangular box.
# Nov 14th, 08:58 BOSS75 in my browser its all fine .
# Nov 14th, 08:58 BOSS75 ?
# Nov 14th, 08:58 BOSS75 how to have this
# Nov 14th, 08:58 BOSS75 if($travelType == 'Round Trip'){
# Nov 14th, 08:44 conehead @scuadra You would do that in beforeMarshal(). After using create/patchEntity, you should always have a valid Entity that you should be able to save straight away. This is not the case if you do it in beforeSave
# Nov 14th, 08:37 scuadra Hello. I have a form where the user fills some fields and one of them is `dates` in format YYYY-MM-DD - YYYY-MM-DD. In Cake 3 where is the right place to parse the user input to start_date and end_date? Is it beforeMarshal() or beforeSave()
# Nov 13th, 10:34 admad Bot is run by the CakePHP team
# Nov 13th, 10:34 challgren Ohh ok, wasnt sure if it was community run or cake run
# Nov 13th, 10:34 admad @challgren you can send a mail to security@cakephp.org
# Nov 13th, 10:33 challgren Yeah got a security exploit to report
# Nov 13th, 10:33 steinkel https://github.com/cakephp/cakebot this one?
# Nov 13th, 10:32 challgren @steinkel do you know who runs @cakebot
# Nov 13th, 10:31 steinkel @pieceof @javier.villanueva setting pagination to a high value will possibly lead to memory issues or a slow frontend processing, would it be possible to filter/paginate the results in the backend instead?
# Nov 13th, 09:41 javier.villanueva : )
# Nov 13th, 09:39 pieceof finally got something like this working... https://:D:D:D:D/api/hugetable.json?date=2019-09-08*andsort=durationanddirection=descandlimit=50 prolly made some mistake, its like working... suspicius
# Nov 13th, 09:39 javier.villanueva I hope it changes for good
# Nov 13th, 09:37 pieceof search changed a lot in 3 gotta re learn it
# Nov 13th, 09:34 javier.villanueva I remember now xD I had forgot old issues
# Nov 13th, 09:34 javier.villanueva yes, I use in this case Search plugin