Logs for #cakephp

Page 10 of 36,154, showing 100 records out of 3,615,322 total, starting on record 901, ending on 1,000

# At Username Text
# Jun 7th, 20:11 challgren The code before
# Jun 7th, 20:09 hollistergraham123 I noticed you use the $Table variable but later you query off the $this variable
# Jun 7th, 20:09 hollistergraham123 What does this reference?
# Jun 7th, 20:07 hollistergraham123 @challgren Awesome, Thank!
# Jun 7th, 20:03 challgren Just make sure to use `use` if you want vars available in the callback
# Jun 7th, 20:02 ricksaccous oh cool
# Jun 7th, 20:01 challgren Using transactional() rolls back/commits automagically
# Jun 7th, 20:01 ricksaccous my bad
# Jun 7th, 20:01 ricksaccous lol yeah that makes sense
# Jun 7th, 20:01 ricksaccous if something fails it all just rolls back?
# Jun 7th, 20:00 ricksaccous oh you don't have to specify rollbacks?
# Jun 7th, 20:00 challgren This is my usage of transactional
# Jun 7th, 19:59 ricksaccous haven't used it in a while
# Jun 7th, 19:59 ricksaccous I think that's how it works anyway
# Jun 7th, 19:59 ricksaccous if it doesn't save
# Jun 7th, 19:59 ricksaccous yeah and you can put in if statements and rollbacks
# Jun 7th, 19:58 hollistergraham123 Or can I do this?
# Jun 7th, 19:57 hollistergraham123 Right I have that page open. But I mean utilizing the ORM. so I can do $this->Table->save() still
# Jun 7th, 19:56 challgren @hollistergraham123 https://book.cakephp.org/3.0/en/orm/database-basics.html#using-transactions
# Jun 7th, 19:55 hollistergraham123 Is there some way to wrap a series of ORM queries and have it roll back all of them if any of them fail?
# Jun 7th, 13:47 niel45 I don't see a problem with miltiple loops though. Separate them into their own methods if you want to keep the concerns separate though
# Jun 7th, 13:47 niel45 if you're worried about too many foreachs, do the processing of the "2" arrays as part of the one loop. i.e. call different methods based on the date
# Jun 7th, 13:46 scuadra and thank you for your time
# Jun 7th, 13:46 scuadra @ricksaccous ok
# Jun 7th, 13:45 ricksaccous @scuadra well if you want play with Hash:: but i don't think in the end it will do anything different, especially since I doubt it will natively do the date comparisons for you
# Jun 7th, 13:43 scuadra @ricksaccous I want to divide the initial array and then to foreach the resulting 2 arrays. I thought there will be too many foreach's
# Jun 7th, 13:42 niel45 yup, KISS
# Jun 7th, 13:41 ricksaccous I mean when it's easy enough to just foreach it i'd just do that
# Jun 7th, 13:41 scuadra I thought there is a better way using Hash::extract or Hash:combine
# Jun 7th, 13:40 ricksaccous what's wrong with a loop and check?
# Jun 7th, 13:39 scuadra How can I divide the array to 2 other arrays based on the date_start is before or after the current date?
# Jun 7th, 13:37 scuadra Let's say I have the following array array( (int) 0 => array( 'Product' => array( 'id' => '1', 'category_id' => '2', 'title' => 'Product1', 'date_start' => '2019-03-10', 'image' => '/images/products/1.jpg' ), 'Category' => array( 'id' => '2', 'name' => 'My Category 2' ) ), (int) 1 => array( 'Product' => array( 'id' => '2', 'category_id' => '3', 'titleg' => 'Product2', 'date_start' => '2019-07-01',
# Jun 7th, 13:37 slackebot 'image' => '/images/products/2.jpg' ), 'Category' => array( 'id' => '3', 'name' => 'My Category 3' ) ), ... )
# Jun 7th, 13:36 scuadra Hello. I have a question regarding Cake 2.x
# Jun 7th, 12:16 yamcomnet anyone got dropzone.js working with cake securityComponent ?
# Jun 7th, 11:39 neon1024 We implemented a Middleware to change the headers to match our requirements
# Jun 7th, 11:39 neon1024 First place I would look would be in the Response class
# Jun 7th, 11:38 neon1024 My guess would be to aid developers and beginners in being able to quickly see their code changes as they develop
# Jun 7th, 11:38 neon1024 It’s my understanding that those headers are sent even when debug is false
# Jun 7th, 10:52 thomas465 Is there a good explanation as to why running with `debug = true` causes the response to be sent with `Cache-Control: no-store, no-cache, must-revalidate` ? I have been trawling through the code but can’t see where this is behaviour is triggerd ?
# Jun 7th, 10:24 liaogz82 and I am not using unit testing for now
# Jun 7th, 10:24 liaogz82 yeah it is E_ALL
# Jun 7th, 09:25 challgren If your using Unit Testing check your phpunit.xml for a `<phpunit><php><ini name="error_reporting" value="32767"/></php></phpunit>`
# Jun 7th, 09:23 challgren I personally use E_ALL
# Jun 7th, 09:22 challgren Somewhere near line 175 depending on your config
# Jun 7th, 09:22 challgren In your src/config/app.php look for Error[errorLevel]
# Jun 7th, 09:21 liaogz82 where can I check that?
# Jun 7th, 09:19 challgren Do you maybe have deprecation notices turned off in your error_reporting?
# Jun 7th, 09:19 liaogz82 cos both uses docker
# Jun 7th, 09:18 liaogz82 ok so how is it possible that it shows up on my DO server when it does not show up on localhost
# Jun 7th, 09:18 liaogz82 ops
# Jun 7th, 09:18 liaogz82 the `getErrors` used to be errors
# Jun 7th, 09:18 challgren ahh thats the Entity
# Jun 7th, 09:17 liaogz82 ``` $this->Workers->save($worker); if (!empty($worker->getErrors())) { $message = $worker->getErrors(); $success = FALSE; } ```
# Jun 7th, 09:14 challgren Can you paste the line?
# Jun 7th, 09:13 liaogz82 controller
# Jun 7th, 09:11 challgren What class are you seeing it in @liaogz82
# Jun 7th, 08:59 liaogz82 nvm I work on it
# Jun 7th, 08:59 liaogz82 strange it wasnt flagged out locally
# Jun 7th, 08:59 challgren and will be removed in 4.0
# Jun 7th, 08:59 challgren @liaogz82 yes because you are using functions that have been deprecated
# Jun 7th, 08:59 liaogz82 has error() been depreciated?
# Jun 7th, 08:58 liaogz82 is this normal?
# Jun 7th, 08:58 liaogz82 I get this in cakephp `errors() is deprecated. Use setError()/getError()`
# Jun 7th, 08:58 jotpe <?php $this->Form->setTemplates(['submitContainer' => '<div class="options main active">{{content}}</div>']); ?> <?= $this->Form->submit('Login'); ?>
# Jun 7th, 08:58 jotpe Right now i have
# Jun 7th, 08:58 jotpe Hey. Can I set the template directly in the creation of a form element?
# Jun 7th, 08:44 k4t May I ask why CakePHP HTTP client use PHP streams instead of e.g. CURL?
# Jun 7th, 08:43 ondrej.nedvidek yep, thanks Mark .. that is what I meant ..
# Jun 7th, 08:22 dereuromark or it is default not null, which would also require some input here.
# Jun 7th, 08:21 dereuromark i think he means the literal field in the DB, probably he has requirePresence activated too eagerly.
# Jun 7th, 08:19 conehead I don't really get what you mean. DisplayField is only used for outputting data?
# Jun 7th, 08:15 ondrej.nedvidek Table displayField. When set the field is required, but for my case I generate it in beforeSave. Any idea how to disable validator for this field? Nedvajz has many questions today, ha ? 8)
# Jun 7th, 07:07 conehead cakephp will handle it
# Jun 7th, 07:07 conehead @liaogz82 Just save the date-time object
# Jun 7th, 07:01 liaogz82 how does one save time for cakephp?
# Jun 7th, 06:53 ondrej.nedvidek Anyone who is interested: `$this->Crud->action()->saveOptions(['validate' => 'admin']);`
# Jun 7th, 06:24 ondrej.nedvidek Does anyone know how to set 'validate' to different set of rules in CRUD validate: https://book.cakephp.org/3.0/en/orm/validation.html#using-a-different-validation-set CRUD: https://crud.readthedocs.io/en/latest/
# Jun 7th, 05:38 conehead Hm I don't really get it. I am trying to keep the `_joinData`. It says `[dirty] => [_joinData => true]`, but there were no changes and the `[original] => ['_joinData']` and the `['_joinData'] is equals. Because of this, the joinData is created a second time
# Jun 7th, 04:51 conehead Hm anyone got an idea how to keep `through` data? Do I actually NEED the `through` table or is it optional?
# Jun 7th, 04:45 conehead Guess it should be `Asia/Malaysia`
# Jun 7th, 04:44 liaogz82 or should it be `Asia/Malaysia`?
# Jun 7th, 04:43 liaogz82 can I set it as `GMT+8`??
# Jun 7th, 04:38 niel45 defaults to UTC IIRC
# Jun 7th, 04:38 niel45 default timezone can be set in your app.php
# Jun 7th, 04:36 liaogz82 ok how do you set the timezone in cakephp?
# Jun 7th, 04:30 conehead And just make sure you get no errors with the timezone
# Jun 7th, 04:29 conehead And save it as DateTime
# Jun 7th, 04:29 conehead I am not an expert, but right now, in ```beforeMarshal()``` I would check if it is a valid timestamp and convert it to DateTime
# Jun 7th, 04:28 liaogz82 `"date_of_birth":1555862400000`
# Jun 7th, 04:28 liaogz82 well customer requirement is the data send over is in miliseconds
# Jun 7th, 04:27 conehead Or an int?
# Jun 7th, 04:27 conehead Why would you? As a string?
# Jun 7th, 04:27 liaogz82 check with you guys, how do you save date time in milliseconds in cakephp?
# Jun 7th, 04:21 liaogz82 oh god no! I go and add it in now
# Jun 7th, 04:17 conehead Did you add the `associated` key? ``` $entity = $articles->newEntity($this->request->getData(), [ 'associated' => [ 'Tags', 'Comments' => ['associated' => ['Users']] ] ]); ```
# Jun 7th, 04:13 liaogz82 this part, should I change `worker_section_type` to `WorkerSectionType`??
# Jun 7th, 04:12 liaogz82 ``` "worker_section_type":{ "section_id":1, "worker_gaji": [{ "code":"PM_3U", "description":"MI 3 UDANG", "amount":"20", "remark":"PAJAK(1 BAG)" }], "worker_tambahan": [{ "code":"FULL_2U", "description":"F/HARIAN >100 BAGS 2 UDG", "amount":"10", "remark":"PAJAK(BAG)" }],
# Jun 7th, 04:12 slackebot "worker_overtime": [{ "code":"5S", "description":"AUDIT 5S", "amount":"1000", "remark":"PAJAK(5S)" }] } ```
# Jun 7th, 04:11 liaogz82 but it does have many to many relationships