Logs for #cakephp

Page 2 of 36,349, showing 100 records out of 3,634,849 total, starting on record 101, ending on 200

# At Username Text
# Yesterday, 16:33 dereuromark read my blog posts :P that things exists for 9+ years in tools plugin for free.
# Yesterday, 16:06 felipe.marinho I create selects (with all the possible values for that database field) AND input text to create new values for that field... but the users are creating/typing values using the input text with trailing spaces...
# Yesterday, 16:02 neon1024 As it sounds like input sanitisation
# Yesterday, 16:02 neon1024 Tell us instead, what you’re actually trying to do
# Yesterday, 16:02 slackebot1 !xy
# Yesterday, 16:02 slackebot1 Command sent from Slack by neon1024:
# Yesterday, 16:02 neon1024 This is
# Yesterday, 16:02 felipe.marinho I have so many fields to do that :,(
# Yesterday, 16:02 neon1024 Or `ltrim()` `rtrim()`
# Yesterday, 16:02 neon1024 Or `preg_replace()`
# Yesterday, 16:02 neon1024 Or `str_replace()`
# Yesterday, 16:01 neon1024 Do.. do you mean.. the php function `trim()~
# Yesterday, 16:01 felipe.marinho Hello, there's any plugin to trim spaces in strings? :thinking_face:
# Yesterday, 15:59 neon1024 I thought Collection::firstMatch
# Yesterday, 15:59 neon1024 I want to see if my Companies have ‘websites’ set, which will be an array of WebsiteEntities
# Yesterday, 15:58 neon1024 Can I check if a result set’s entities have non-empty properties?
# Yesterday, 15:29 ndm It certainly won't make them faster, but it also doesn't necessarily have to overly slow them down, it really depends on the query and how you can rewrite it to conform to the strict mode. Not a fan, but if applicable there's `ANY_VALUE()`, which will give you the same behavior as with ONLY_FULL_GROUP_BY disabled.
# Yesterday, 15:21 ricksaccous yeah but it slows down queries though :(
# Yesterday, 14:58 ndm @mrfeedback There's a good reason the strict mode exists. In the lax mode MySQL will usually pick non-aggregated rows from the groups in a nondeterministic manner, unless you can force MySQL to pick a specific one. So be careful and make sure that you really receive the correct data with ONLY_FULL_GROUP_BY disabled.
# Yesterday, 14:52 mrfeedback is there a way to access the main query when using matching? I need to adapt the where statements according to the type of product. And so far i dont see any other option to achieve that
# Yesterday, 14:50 mrfeedback yes I am absolutely with you
# Yesterday, 14:46 hippo might not matter but it's good to be careful
# Yesterday, 14:45 francis.nadal @admad I figured it out thanks hehe
# Yesterday, 14:44 mrfeedback hmm thanks for the hint!
# Yesterday, 14:44 mrfeedback true story
# Yesterday, 14:44 hippo yeah until someone upgrades mysql
# Yesterday, 14:44 hippo or thats what id' do at least
# Yesterday, 14:44 mrfeedback i just tested it. its turned off on the server
# Yesterday, 14:44 hippo like adding in a check to see if it's disabled in bootstrap
# Yesterday, 14:43 hippo if you turn it off you need to be sure that whoever is managing servers for this knows that it needs to be turned off
# Yesterday, 14:42 mrfeedback lets say i want to select all proejcts with `producttype_id=1` and `producttype_id=2`. But if it is `producttype_id=1` I need to have in projectfilestable fullfilled two conditions `projectfile.marketingthumb>0` and `projectfile.videothumb>0` but if it is `producttype_id=2` it is only need for `projectfile.marketingthumb > 0`. any ideas how i could create such a query with cake?
# Yesterday, 14:37 mrfeedback i have to admit db is just an untouched mysql 5.7 docker container
# Yesterday, 14:37 mrfeedback hmm so you think i should turn it off?
# Yesterday, 14:31 francis.nadal @admad sorry, where should I put the dd(func_get_args())?
# Yesterday, 14:28 ricksaccous geez
# Yesterday, 14:28 ricksaccous that thing slows down queries a lot
# Yesterday, 14:28 ricksaccous lmao
# Yesterday, 14:27 neon1024 Guess we’re sticking with MySQL 5.7 then :,)
# Yesterday, 14:26 graziel iirc they said they will disable that switch as some point so it will come back
# Yesterday, 14:25 neon1024 I must admit, I tend to turn it off myself
# Yesterday, 14:24 neon1024 I think it’s because this is incompatible with sql_mode=only_full_group_by
# Yesterday, 14:14 mrfeedback any idea why `$query->distinct(['Projects.id']);` `$query->group('Projects.id');` does not work? I get `PDOException: SQLSTATE[42000]: Syntax error or access violation: 1055 Expression #33 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'vvv_test.Marketinginfos.id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by` as I am also joining other
# Yesterday, 14:14 slackebot1 tables like `marketinginfos`
# Yesterday, 14:12 ricksaccous i did something similar in a subquery join
# Yesterday, 14:11 ckjksl but would that take a while?
# Yesterday, 14:11 ckjksl I could get unique ids from all the items first and then foreach id, search for their latest entry
# Yesterday, 14:11 ckjksl Yes, that would work if i was looking for a particular item. But I'm trying to get all the latest entry of all the items (from a certain date)
# Yesterday, 14:10 ricksaccous order->(['destinations.validfrom' => 'desc']);
# Yesterday, 14:10 ricksaccous ->limit(1);
# Yesterday, 14:09 ckjksl I need the last entry from today, not all the entries from today
# Yesterday, 14:09 ricksaccous what's the problem here
# Yesterday, 14:09 ricksaccous so wouldn't that make sense
# Yesterday, 14:09 ricksaccous you are getting anything less than today it seems
# Yesterday, 14:08 ckjksl this is cool and all, but I think this experession actually gets me both the Feb 2019 entry and the May 2019 entry
# Yesterday, 14:08 ckjksl right now I have: `->andWhere(function($exp) use($validdate) { $exp->lte('destinations.validfrom', $validdate);return $exp;})`
# Yesterday, 14:07 ckjksl I have multiple entries for the same item, but each of the entries have a valid date. Example: if i search with a date of Feb 2019, I will only find things valid from Feb 2019. If there is a change in May 2019 and I search today, I should get the latest version, which is the May 2019.
# Yesterday, 14:06 ricksaccous use date time objects in the ORM
# Yesterday, 14:05 ckjksl I've got a question about ORM and searching with dates
# Yesterday, 14:04 mehov Okay, `$this->request->getSession()->read('Auth.User')` - but won't `request` get deprecated and replaced with `getRequest()` in 4.x?
# Yesterday, 14:00 alexdd55976 it does... working with at this moment
# Yesterday, 14:00 mehov Hi all, I need to know if user is logged in inside a Layout file. I found https://stackoverflow.com/questions/5901685/cakephp-check-if-user-is-logged-in-inside-a-view/, but it's either outdated, or doesn't work, or feels workaround-ish I put this in my AppController ``` public function beforeFilter(\Cake\Event\Event $event) { $this->set([ 'APP_user' => $this->Auth->user(), ]); } ``` and it gives me
# Yesterday, 14:00 slackebot1 `Undefined variable: APP_user`, and this feels workaround-ish too What is the common accepted practice for this that'll work with 4.x? I don't need the complete answer, just link to the docs would be great
# Yesterday, 13:45 neon1024 I wonder if codeception supports fixtures :thinking_face: Although that’s a lot of data to ingest per test-case, unless it was a suite level import
# Yesterday, 13:41 neon1024 When creating an acceptance test suite, using something like codeception, do you populate forms with data and submit them as part of a test? Wouldn’t test data build up in the dev db this way?
# Yesterday, 13:41 admad @francis.nadal use `dd(func_get_args())` in your closure and you will get idea of all arguments passed to it :slightly_smiling_face:
# Yesterday, 12:37 francis.nadal um hi @jotpe hope you're not very busy as of the moment hehe. just a question, I'm trying to rename my photos and I'm using nameCallback of the cake-upload plugin. But I'm seem to be confused about what to put in the arguments
# Yesterday, 12:01 jotpe You're welcome
# Yesterday, 12:01 francis.nadal @jotpe thank you again! I will try and see if any problem comes up hehe
# Yesterday, 12:00 jotpe @francis.nadal that should work :slightly_smiling_face:
# Yesterday, 12:00 jotpe @vjnvisakh I use CakePdf (https://github.com/FriendsOfCake/CakePdf/tree/1.0) in a old project. You need to create a .ctp as template and pass some viewVars
# Yesterday, 11:58 francis.nadal @jotpe my other question is, they have different validation should I put them differently like this?
# Yesterday, 11:57 francis.nadal @jotpeindeed! thank you very much for your help. I will be using the plugin
# Yesterday, 11:54 jotpe When you remove (or comment out) the validator the file is not validated, so better add some rules :slightly_smiling_face:
# Yesterday, 11:53 jotpe it's path
# Yesterday, 11:53 jotpe @francis.nadal there you go: https://cakephp-upload.readthedocs.io/en/latest/configuration.html#behavior-configuration-options
# Yesterday, 11:46 slackebot1 <francis.nadal>
# Yesterday, 11:46 francis.nadal @jotpe file was moved too but only the filename was saved in the db. so I might need to check cake-upload plugin documentation how to add the path so that I can render the image in frontend as well
# Yesterday, 11:45 francis.nadal actually while I tried commenting out the validator with scalar my entry was successful
# Yesterday, 11:45 vjnvisakh How to make a pdf from a url in cake2
# Yesterday, 11:43 francis.nadal um, sorry very noob question, could I try all of them like this?
# Yesterday, 11:42 neon1024 Nor do they have a max length
# Yesterday, 11:42 neon1024 They are array
# Yesterday, 11:42 neon1024 Uploaded files are not scalar
# Yesterday, 11:41 jotpe Have fun :slightly_smiling_face:
# Yesterday, 11:41 francis.nadal thank you! looking into it now
# Yesterday, 11:40 jotpe Remove the validator with photo and try something from https://cakephp-upload.readthedocs.io/en/latest/validation.html#uploadvalidation
# Yesterday, 11:38 francis.nadal that would be
# Yesterday, 11:38 jotpe What's the content of validationDefault() in UsersTable for photo?
# Yesterday, 11:37 jotpe There's something with your Validation Rules in UsersTable
# Yesterday, 11:35 francis.nadal does it mean I ahve to set path to where the photos will be moved?
# Yesterday, 11:35 francis.nadal @jotpe running this $this->request->getData('photo'); I get this
# Yesterday, 11:34 alexdd55976 seems that you need to add a file when you want to add a user
# Yesterday, 11:33 francis.nadal @jotpe hi i get this when debug is enabled
# Yesterday, 11:31 jotpe Form looks good. You see the post data with `if ($this->request->is('post')) { debug($this->request->getData('photo'));...`
# Yesterday, 11:27 francis.nadal @conehead this is my form
# Yesterday, 11:26 conehead And how does your form look like?
# Yesterday, 11:26 francis.nadal Thank you very much! I will try it right now
# Yesterday, 11:25 slackebot1 <jotpe>
# Yesterday, 11:25 jotpe @francis.nadal I don't know about this plugin, but you can try to debug it. In your UsersController try something like this:
# Yesterday, 11:15 francis.nadal Do I also need to configure this here in users table?