Logs for #cakephp

Page 3 of 36,349, showing 100 records out of 3,634,849 total, starting on record 201, ending on 300

# At Username Text
# Yesterday, 11:15 francis.nadal hello, I have a question regarding the cakephp-upload plugin. I wanted to have a photo upload for users and it was suggested to me to use it. But I was trying out their documentation example(https://cakephp-upload.readthedocs.io/en/latest/examples.html) but I seem to not get it to work. I always get this error.
# Yesterday, 10:02 koeller If I do it your way I don’t have to do the setConnection on the loaded Model :slightly_smiling_face: Thank you!
# Yesterday, 09:52 slackebot1 <challgren>
# Yesterday, 09:51 slackebot1 <challgren>
# Yesterday, 09:50 challgren That might be your issue is your loading the config after the alias
# Yesterday, 09:49 challgren and maybe load your config before the alias
# Yesterday, 09:45 koeller To have be aware of not configured connection names passed?
# Yesterday, 09:44 challgren @koeller did you try to inspect it with `ConnectionManager::configured()`?
# Yesterday, 09:41 koeller @alexdd55976: For now I’m able to perform the action I want in loading the connection into the Model directly, like: ```$this->Users ->setConnection(ConnectionManager::get($args->getArgument('connection')))```
# Yesterday, 09:21 alexdd55976 @koeller i do not know, but if you find the solution can you add to docu and do a PR on it?
# Yesterday, 09:18 koeller Hey, How can I switch a database in a Command. I’ve tried in command execute(): `ConnectionManager::alias($args->getArgument(‘connection’), ‘default’); Configure::load($args->getArgument(‘connection’), ‘default’, true);` But that doesn’t work :S I haven’t found anything in the documentation on that topic, either.
# Yesterday, 09:08 challgren Evening all!
# Yesterday, 08:51 neon1024 Wishing everyone a great day! :tada:
# Yesterday, 08:50 neon1024 Heya everyone
# Yesterday, 07:20 jotpe Morning, folks!
# Yesterday, 06:47 javier.villanueva morning!
# Yesterday, 06:32 alexdd55976 good morning
# Oct 16th, 21:42 slackebot1 'marketingthumb >' => 0 ] ]``` any ideas how to achieve that?
# Oct 16th, 21:42 slackebot1 'Products', 'Marketinginfos', 'Clients', 'Projectfiles' ] ); $query->where(['active' => true]); $query->order(['Projects.id' => 'DESC']); return $query; } ``` this is of course not 100% correct as the condition is to open in ``` return $q->where( [ 'OR' => [ 'marketingvideo >' => 0,
# Oct 16th, 21:42 slackebot1 'Projectfiles', function (Query $q) { return $q->where( [ 'OR' => [ 'marketingvideo >' => 0, 'marketingthumb >' => 0 ] ] ); } ); $query->cache('project_list_video_images'); $query2 = $this->Projects->find('all')
# Oct 16th, 21:42 slackebot1 ->contain(['Marketinginfos', 'Products']) ->toArray(); debug($query2); return $query; } private function __prepareApiMarketingGetProjectList() { $query = $this->find(); $query->matching( 'Marketinginfos', function (Query $q) { return $q->where(['closed' => true]); } ); $query->contain( [
# Oct 16th, 21:42 slackebot1 ``` public function ApiGetProjectListVideoAndImages() { $query = $this->__prepareApiMarketingGetProjectList(); $query->matching( 'Products', function (Query $q) { return $q->where( [ 'producttype_id' => [1,2], ] ); // Videos and Images Only } ); $query->matching(
# Oct 16th, 21:42 mrfeedback i am not sure how i can build a query for the following example: i have projects I want to select `projects` which have in `marketinginfos.closed = true`, and `producttype_id` either `1` or `2` and if it is `producttype_id = 1` it has to have at least one `projectfiles.marketingthumb > 0` and `projectfiles.video > 0` if it is `producttype_id=2` it as to have at least one `projectfile.marketingthumb > 0` only. my approach is the following
# Oct 16th, 16:49 ssalvatori I want to test the internal logic of the listerner
# Oct 16th, 16:49 ssalvatori hello, hey any examples how to test a EventListener ?
# Oct 16th, 16:47 javier.villanueva Im testing with 10.000 and time to save its very up
# Oct 16th, 16:47 javier.villanueva I may not need lft and rght structure
# Oct 16th, 16:45 javier.villanueva ok
# Oct 16th, 16:44 admad MPTT is optimized for read
# Oct 16th, 16:44 admad it won't crash on finds but more like on saves :slightly_smiling_face:
# Oct 16th, 16:09 javier.villanueva ok i will make it
# Oct 16th, 16:09 ndm Finds shouldn't be an issue even with billions of records (assuming your DBMS can handle large amounts of data in general), writes on the other hand can be very expensive. Generate some test data and try it out.
# Oct 16th, 16:01 javier.villanueva really when I write finds is reorder
# Oct 16th, 15:47 javier.villanueva Im using the tree behaviour in a model, probably with 2 million of records, a person tell me that probably it will be crash in finds... any advice about it?
# Oct 16th, 14:00 paul_83uk ok useful to know thanks.
# Oct 16th, 13:58 admad gtg
# Oct 16th, 13:58 admad FYI it's the `ResponseEmitter` class with makes the `setcookie()` calls. So if you do upgrade to php 7.e then for now you can use your own reponse emitter class which overrides relevant method and pass your emitter instance to $server->emit() call in webroot/index.php
# Oct 16th, 13:58 paul_83uk haha love the pic! coookieeee!!
# Oct 16th, 13:58 paul_83uk ahhh ok! sorry hadn't realised that at all. no wonder CakePHP class isn't supporting it yet.
# Oct 16th, 13:57 admad https://ayesh.me/PHP-Samesite-cookies
# Oct 16th, 13:57 admad set you can't set `SameSite` option since php itself has no support for hit prior to 7.3
# Oct 16th, 13:56 paul_83uk in production
# Oct 16th, 13:56 paul_83uk 7.2.19 at the mo
# Oct 16th, 13:55 admad @paul_83uk are you using php 7.3?
# Oct 16th, 13:53 david is the ->translation() method the provided by the trait?
# Oct 16th, 13:51 david Mmm, I think I have made a mistake reading the docs
# Oct 16th, 13:48 admad just using the trait won't do anything, you have to use the method the trait provides :slightly_smiling_face:
# Oct 16th, 13:48 david the result of that pr() is the same using or not the TranslaitTrair
# Oct 16th, 13:47 david <?php pr($this->Variables->find('translations')->first()); ?>
# Oct 16th, 13:47 david I am using Translate behaviour. Documentation says that "Working with multiple translations can be done by using a special trait in your Entity class" (using TranslateTrait). I have an entity not using TranslateTrait, and I can't find any difference between using and not using it.
# Oct 16th, 13:42 paul_83uk Hi All, I'm using Cake\Http\Cookie to create all cookies for my site but I'm looking to set 'SameSite=Lax' as one of the configuration values (I have a PEN test coming up). This does not appear to be an option within the class. Is there a way around this or do I need to stop using the class for now?
# Oct 16th, 12:19 eax Good to know, thanks @dereuromark! :slightly_smiling_face:
# Oct 16th, 12:17 dereuromark dunno, but for us ulimit -n 65535 worked with larger code base.
# Oct 16th, 12:17 eax @dereuromark Ok, that’s the only solution?
# Oct 16th, 12:17 dereuromark set ulimit higher
# Oct 16th, 12:16 eax Hi folks! Just upgraded from Cake 3.7.6 to 3.8.5, and I am having some issues running my tests. Specifically, I get: failed to open stream: Too many open files in /home/sites/mysite/htdocs/vendor/composer/ClassLoader.php on line 412. This didn’t happen before the upgrade. Any ideas what I could be doing wrong?
# Oct 16th, 11:33 javier.villanueva yes ... im very nerd... last time with csv extension i had the same problem, and I forgot it
# Oct 16th, 11:32 admad hopefully learned an important lesson in debugging :slightly_smiling_face:
# Oct 16th, 11:32 javier.villanueva i forgot exclude this extension for the theme
# Oct 16th, 11:32 javier.villanueva solved... after hours... is the theme
# Oct 16th, 11:31 javier.villanueva ok
# Oct 16th, 10:10 javier.villanueva if someone has been able to install cakePdf in Cakephp 3.8 please notice me :S
# Oct 16th, 08:37 javier.villanueva cakepdf ignore my config.... :( always show a pdf viewer and return An error ocurred loading a pdf file
# Oct 16th, 08:34 admad try using expression instead of key => value in conditions
# Oct 16th, 08:23 scuadra I also tried the third param of where to be true
# Oct 16th, 08:22 scuadra and my where clause ->where($this->conditions, ['id' => 'string'])
# Oct 16th, 08:22 scuadra these are my conditions $conditions["$field LIKE"] = "%$value%";
# Oct 16th, 08:21 scuadra @admad I still get the error "Cannot convert value of type `string` to integer"
# Oct 16th, 08:18 javier.villanueva i set default config with a CakePdf.php file in config
# Oct 16th, 08:17 javier.villanueva ok, config problem solved with cakepdf...
# Oct 16th, 08:17 ra7bi when i check the Request after post i can see Requests => ids => [0=>12, 1=>13]
# Oct 16th, 08:16 ra7bi do patchEntity can handle that ?
# Oct 16th, 08:15 ra7bi i also tried what ndm told me but can not make it work .
# Oct 16th, 08:14 ra7bi I have three tables , ``` Requests ---> BelongToMany ---> Details ``` and i have ``` Reports -----> BelongTo ---> Requests``` i want in Add report form add a Requests Details i tried ``` $this->select('Requests.'.$request->id.'.Details._ids' ) ``` and ``` $this->select('Requests.'.$request->id.'.Details._fieldName' ) ``` but not working
# Oct 16th, 08:10 javier.villanueva Configure::write('CakePdf', [ 'engine' => [ 'className' => 'CakePdf.WkHtmlToPdf', 'binary' => 'C:\\wkhtmltopdf\\bin\\wkhtmltopdf.exe', 'cwd' => 'C:\\wkhtmltopdf\\bin' ], 'margin' => [ 'bottom' => 15, 'left' => 50, 'right' => 30, 'top' => 45 ], 'orientation' => 'landscape', 'download' => true ]);
# Oct 16th, 08:10 javier.villanueva this is my config
# Oct 16th, 08:07 scuadra ah, ok :slightly_smiling_face:
# Oct 16th, 08:07 scuadra how to do it :face_with_rolling_eyes:
# Oct 16th, 08:07 admad 'string'
# Oct 16th, 08:07 scuadra @admad I tried ['id' => 'varchar'] but with no effect
# Oct 16th, 08:06 admad @scuadra override the field using $types argument of where()
# Oct 16th, 08:00 scuadra and I am still getting "Cannot convert value of type `string` to integer" error
# Oct 16th, 07:59 scuadra In cake2 it was OK but now I have issues to make it work
# Oct 16th, 07:59 javier.villanueva I havent.... but configure 404 is getEngine... then seems this missing configuration
# Oct 16th, 07:58 scuadra when I type 12 I want to get all the apps that start with 12 -> 12, 123, 121, 1243.....
# Oct 16th, 07:58 javier.villanueva WkHtmlToPdfEngine
# Oct 16th, 07:58 spriz @javier.villanueva and do you have a stacktrace?
# Oct 16th, 07:58 spriz @javier.villanueva it sounds like there is some missing configuration - which engine are you trying to use?
# Oct 16th, 07:58 spriz @scuadra but why would you need to use `LIKE` for that?
# Oct 16th, 07:57 javier.villanueva seems that not found the engine, but I have specified in app.php
# Oct 16th, 07:57 scuadra @spriz I have application table and I want to search the app number (id column which is integer)
# Oct 16th, 07:55 javier.villanueva any idea?
# Oct 16th, 07:55 javier.villanueva I am trying to use CakePDF (https://github.com/FriendsOfCake/CakePdf) load the plugin in bootstrap.php and appear the next error: Warning: Illegal offset type in isset or empty in src\Core\Configure.php on line 404
# Oct 16th, 07:54 spriz Why do you want to do that? :)
# Oct 16th, 07:54 spriz and also the use case sounds weird
# Oct 16th, 07:54 spriz but take care of MySQL performance issues :)
# Oct 16th, 07:54 spriz @scuadra you can do `->where(['Comments.priority LIKE' => '1_'])`
# Oct 16th, 07:52 scuadra Hello. How can I use LIKE as a condition on an integer column? I am using Cake 3.x and MySQL 5.7.
# Oct 16th, 07:45 david morning
# Oct 16th, 07:06 javier.villanueva morning