Logs for #cakephp

Page 3 of 36,061, showing 100 records out of 3,606,097 total, starting on record 201, ending on 300

# At Username Text
# Mar 19th, 14:29 jeremyharris ah yes, that can be a bit more tricky. here is the documentation for that: https://book.cakephp.org/3.0/en/views/helpers/form.html#creating-inputs-for-associated-data
# Mar 19th, 14:28 ricksaccous lollll
# Mar 19th, 14:28 ricksaccous the solution is wonky javascript
# Mar 19th, 14:28 feLiruc Ohhh, my relationship is OK, the bake got it correct... my problem is to create the template with this 2 entities for the user... the fill the event, and N attendants in the same screen
# Mar 19th, 14:26 jeremyharris or perhaps a belongsToMany, if attendants can be part of multiple events
# Mar 19th, 14:25 jeremyharris feLiruc I think you are looking for a hasMany relationship. you can find information about it here: https://book.cakephp.org/3.0/en/orm/associations.html#hasmany-associations
# Mar 19th, 13:27 feLiruc Hello guys, can anybody help me how to create an add page to create a 1 to n information? Like event and attendant...
# Mar 19th, 12:19 feLiruc Hello guys... what´s the smartest way to create an add page to create a 1 to n relationship model? like, one event with a list of participants... I want to add the participants list just in 1 page.
# Mar 19th, 08:02 challgren np
# Mar 19th, 06:21 latenal @challgren, you were right. This is an accessibility problem. There was ‘monitors’ in the list not `monitor` Thanks a lot!
# Mar 19th, 06:14 latenal Here is it: https://book.cakephp.org/3.0/en/orm/saving-data.html#saving-hasone-associations The problem is that in the example they create *a new entity with an ID*. I don’t have an ID when I create a record. It’s auto-incremented.
# Mar 19th, 06:11 latenal I’ve read it multiple times. I think everything is according to the doc, but it doesn’t work
# Mar 19th, 06:10 latenal This is the data: `Array ( [firstname] => TestName [lastname] => TestLastname [cellphone] => 1231231231 [username] => monitor2 [monitor] => Array ( [department_id] => 1 ) )`
# Mar 19th, 06:09 challgren https://book.cakephp.org/3.0/en/orm/saving-data.html#patching-hasmany-and-belongstomany
# Mar 19th, 06:08 latenal Yes
# Mar 19th, 06:04 challgren Accessible
# Mar 19th, 03:23 latenal Hey, I am using cake 3.7 I am trying to save hasOne but it never saves the associated value. There are 2 tables Users and Monitors (one-to-one) ` $this->hasOne(‘Monitors’, [ ‘foreignKey’ => ‘user_id’, ‘joinType’ => ‘INNER’ ]) ` This is the way I save it: ` $entity = $this->Users->newEntity(); $entity = $this->Users->patchEntity($entity, $data, [‘associated’ => [‘Monitors’]]);
# Mar 19th, 03:23 slackebot2 $this->Users->save($entity, [‘associated’ => [‘Monitors’]])) ` It saves the `User`, but it doesn’t save `Monitor` data How do I save the assoc model?
# Mar 19th, 02:16 chrisshick It had to do with the CRUD api plugin that I use. It automatically enables the query log
# Mar 19th, 02:16 chrisshick @markstory I found the issue.
# Mar 18th, 22:03 massimoi Hi, I've got a question about page cache (cake 2.x). I'm using caching for static pages (Pages/name.ctp). When I enable translations, the cache "hides" the translation (es: eng/pages/name == ita/pages/name), *how should I configure the cache?*
# Mar 18th, 21:37 itmpls n/m, scope doh
# Mar 18th, 21:36 itmpls how can I add another unique constraint so its 2 fields instead of one? for ex `->add('field','unique',['rule' => 'validateUnique']);`
# Mar 18th, 19:17 m even I did not think that haha :slightly_smiling_face: I'm just a worthless guy.. and will go cry in a corner by myself eating cookies
# Mar 18th, 19:16 admad @m of course if was your fault, no body thought otherwise :slightly_smiling_face:
# Mar 18th, 19:09 m @admad: I'm honest enough: It was my own fault, I was updating the wrong (similar named and similar path.. ) project folder .. which was still at an earlier version of Cake. So it works and is fixed. Thanks again for your help.
# Mar 18th, 18:28 m yes, was doing that now :slightly_smiling_face: thanks
# Mar 18th, 18:28 admad delete your vendor/cakephp/cakephp folder and run composer update again
# Mar 18th, 18:27 admad @m you mention `compact('etagMatches', 'timeMatches')` generating errors in Response class. But Response class no longer has any compact() call https://github.com/cakephp/caakephp/blob/3.7.5/src/Http/Response.php
# Mar 18th, 18:27 m but i can see the fix at github; so ill figure it out myself. Thanks for your time
# Mar 18th, 18:26 slackebot2 <birdy247>
# Mar 18th, 18:26 m hm; any idea why i dont have it when i'm at 3.7.5 ?
# Mar 18th, 18:26 admad @m that fix was done quite a quite ago, it is present in latest release
# Mar 18th, 18:25 birdy247 if i perform the exact same callback in "name"
# Mar 18th, 18:25 slackebot2 <birdy247>
# Mar 18th, 18:25 chris-andre @birdy247 Not sure how/why, but name has to come from somewhere? From the entity being patched?
# Mar 18th, 18:25 birdy247 if I check the data higher up i.e. name
# Mar 18th, 18:25 m ive checked github for cakephp/cakephp dev-master and i see a "php7.3" fix. Could it be that dev-master fixes that? instead of ^3.7 ?
# Mar 18th, 18:24 birdy247 This is odd
# Mar 18th, 18:23 m It's probably my fault, somewhere, but I can't put my finger on it; it seems to be Cake (to me at the moment)
# Mar 18th, 18:22 m admad: I am using 3.7.5 (checked the file in vendor and ran composer again given ^3.7
# Mar 18th, 18:20 birdy247 yet the entity has "name" set
# Mar 18th, 18:20 birdy247 data is empty
# Mar 18th, 18:20 slackebot2 <birdy247>
# Mar 18th, 18:20 admad @m check vendor/cakephp/cakephp/VERSION.txt
# Mar 18th, 18:19 birdy247 despite other fields having data
# Mar 18th, 18:19 admad @m i doubt you are using latest cake 3.7 release
# Mar 18th, 18:19 birdy247 but the $context['data'] is empty
# Mar 18th, 18:19 birdy247 I am using a callback
# Mar 18th, 18:19 birdy247 yes
# Mar 18th, 18:19 chris-andre `allowEmptyString( string $field , boolean|string|callable $when true , string|null $message null )`
# Mar 18th, 18:16 birdy247 in allowEmptyString, is the callback only expecting 1 arg?
# Mar 18th, 18:15 birdy247 In the notEmpty, the callback used to have the data and context
# Mar 18th, 17:07 m for me the problems start with PHP7.3 and some stuff (probably) in core :P
# Mar 18th, 17:06 m aro: what is wrong? I've been running cake3 (mostly 3.5+) on PHP7.2 for a while now
# Mar 18th, 17:01 aro Weird
# Mar 18th, 17:01 jeremyharris the core testsuite runs on 7.2 so I wouldn’t think it would be an issue with the core
# Mar 18th, 17:01 aro 7.0 is past EOL
# Mar 18th, 17:00 aro 7.0?
# Mar 18th, 17:00 jeremyharris how so?
# Mar 18th, 17:00 alexdd55 weird.. but 7.0 is buggy akaik
# Mar 18th, 16:59 aro Well we upgraded our install of PHP from 7.0 to 7.2, and things went completely south
# Mar 18th, 16:59 jeremyharris I believe it always supported 7.2, as the requirements are 5.6 or greater for cake 3
# Mar 18th, 16:47 aro what version of cakephp 3 added support for php7.2
# Mar 18th, 16:08 m for now; I've "fixed" (havent exactly proofed equivalence but still) it by escaping the "invalid range" in the regexp's for "SqlDialectTrait" by escaping the "-" character with "\-" . This seems to work for both line 64 and 75 in that file ( method quoteIdentifier($identifier) ). If i was sure about my fixes, I would have created a pull-request, but I'm not.
# Mar 18th, 15:54 slackebot2 havent found a solution yet. Problem 2: I get 2 notices for missing/initialized variabels in file "\Cake\Http\Response" at line 2059 and line 2064. It seems that the 2 variables "etagMatches" and "timeMatches" are not set in the main scope and thus i get an error at compact('etagMatches', 'timeMatches'). I fixed this (locally, in cake core.. ) initializing both variables to "false" at the top of the method "checkNotModified". Could this be an
# Mar 18th, 15:54 slackebot2 error/bug in the cake core code (for first problem, second seems a code error to me)? Or did I just mess up my server :P Thanks in advance
# Mar 18th, 15:54 m Hey guys. Hope all are well. I've just upgraded my local server to PHP7.3.3 and have composer updated to latest version for CakePHP (3.7.5). I noticed 2 problems (error logs), most sites/code works fine. Problem 1: I get a lot of errors on "preg_match()" in the class "\Cake\Database\SqlDialectTrait" (line 75). That preg_match contains "_\s" in the regex and reading stackoverflow, it seems PHP changed something that does not allow it anymore. I
# Mar 18th, 13:37 patox44 I found solution. I redirect vhost to /rest/webroot and wrote this htaccess in webroot
# Mar 18th, 13:14 val https://github.com/cakephp/cakephp/blob/2.x/lib/Cake/TestSuite/CakeTestCase.php#L78
# Mar 18th, 13:13 val Hi, can anyone help to figure out what is wrong in `CakeTestCase::run`? https://github.com/cakephp/cakephp/pull/13058#issuecomment-473903258
# Mar 18th, 12:29 alexdd55 anyone who can tell how i can run tests on `validationDefault`?
# Mar 18th, 12:28 alexdd55 hi fellows
# Mar 18th, 11:46 kkitchen @patox44 -- I'm not sure. I'm kind of a surface-dweller when it comes to Apache rules... we're over my head at this point. :thinking_face: Hopefully our discussion will trigger ideas from someone else, though.
# Mar 18th, 10:52 patox44 when I copied htaccess from wordpress I see these pages, but it redirect me to main project when I write something like {url}/rest/api. How should I rewrite routing? I mean everything after index
# Mar 18th, 10:45 kkitchen k. Well, I'm just being a rubber ducky at this point, because I've not done specifically what you're doing. :slightly_smiling_face: I will say, though, it reminds me of how WordPress handles multisite subdirectory installations... maybe something on their .htaccess page could be helpful: https://codex.wordpress.org/htaccess
# Mar 18th, 10:43 patox44 yeah. I have 3 folders in project and I join by alias admin and cakephp, but I can't join cake
# Mar 18th, 10:41 kkitchen Gotcha. Is "public" and "admin" also CakePHP?
# Mar 18th, 10:40 patox44 after it I got "The requested URL /var/www/project/rest/webroot/ was not found on this server."
# Mar 18th, 10:38 patox44 It's one domain. Main is on {url}/, admin is on {url}/admin, rest is on {url}/rest
# Mar 18th, 10:36 kkitchen Also, @patox44, are you using different subdomains for each of these sites or is one domain trying to serve them all?
# Mar 18th, 10:33 kkitchen @patox44 What happens if you run just the basic comes-with .htaccess?
# Mar 18th, 10:24 patox44 @kkitchen yes. Here is configuration. front and admin works fine. When I try join rest I can run only homepage. Routing not works
# Mar 18th, 10:20 kkitchen @patox44 Are you using an Apache virtual host for this site?
# Mar 18th, 10:12 patox44 it's my htaccess in webroot folder
# Mar 18th, 09:49 patox44 P.S. I can see only homepage
# Mar 18th, 09:43 patox44 hello. How can I install cakePHP in subdirectory? When I try do it I got error `The requested URL /var/www/project/rest/webroot/index.php was not found on this server.`
# Mar 18th, 09:05 steinkel @ssalvatori if you need to override plugin configuration, add your custom configuration and load it in Application::pluginBootstrap method, after bootstrapping the plugin. Keep in mind the plugin configuration is NOT loaded when you call addPlugin, but later
# Mar 17th, 21:34 qxd sorry noob
# Mar 17th, 21:33 qxd msg NickServ identify passworda
# Mar 17th, 21:33 qxd msg NickServ identify password
# Mar 17th, 11:48 birdy247 so its not a huge overhead
# Mar 17th, 11:48 birdy247 typically there will only be upto 5 other records
# Mar 17th, 11:46 edgaras.jan yes, but it retrieves all records, but uses only the last one
# Mar 17th, 11:44 birdy247 all tests are passing with that
# Mar 17th, 11:44 birdy247 my original aproach works
# Mar 17th, 11:44 birdy247 @edgaras.jan to be honest
# Mar 17th, 11:18 birdy247 no luck :(
# Mar 17th, 11:16 edgaras.jan comment out for now
# Mar 17th, 11:16 edgaras.jan yes