Log message #4209312

# At Username Text
# Oct 17th 2019, 17:02 dereuromark collections if object collection, for array it is clear
# Oct 17th 2019, 17:02 dereuromark true as in !empty() returns true here
# Oct 17th 2019, 17:02 dereuromark @admad wouldnt a collection return true on empty (count 0) for this?
# Oct 17th 2019, 16:43 admad @neon1024 what's wrong with simply `!empty($company->websites)` ?
# Oct 17th 2019, 16:42 dereuromark In general, no app should ever go live without this component or sth similar on middleware activated, as it is basically a recipe for desaster if you trust your validation rules to work ;)
# Oct 17th 2019, 16:42 dereuromark You just need to be a bit more precise in your questions :slightly_smiling_face: It is about payload trimming your case it seems.
# Oct 17th 2019, 16:38 felipe.marinho Thank you @dereuromark :pray:
# Oct 17th 2019, 16:33 dereuromark https://github.com/dereuromark/cakephp-tools/blob/master/docs/Component/Common.md#trimming-payload-data
# Oct 17th 2019, 16:33 dereuromark read my blog posts :P that things exists for 9+ years in tools plugin for free.
# Oct 17th 2019, 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...
# Oct 17th 2019, 16:02 neon1024 As it sounds like input sanitisation
# Oct 17th 2019, 16:02 neon1024 Tell us instead, what you’re actually trying to do
# Oct 17th 2019, 16:02 slackebot1 !xy
# Oct 17th 2019, 16:02 slackebot1 Command sent from Slack by neon1024:
# Oct 17th 2019, 16:02 neon1024 This is
# Oct 17th 2019, 16:02 felipe.marinho I have so many fields to do that :,(
# Oct 17th 2019, 16:02 neon1024 Or `ltrim()` `rtrim()`
# Oct 17th 2019, 16:02 neon1024 Or `preg_replace()`
# Oct 17th 2019, 16:02 neon1024 Or `str_replace()`
# Oct 17th 2019, 16:01 neon1024 Do.. do you mean.. the php function `trim()~
# Oct 17th 2019, 16:01 felipe.marinho Hello, there's any plugin to trim spaces in strings? :thinking_face:
# Oct 17th 2019, 15:59 neon1024 I thought Collection::firstMatch
# Oct 17th 2019, 15:59 neon1024 I want to see if my Companies have ‘websites’ set, which will be an array of WebsiteEntities
# Oct 17th 2019, 15:58 neon1024 Can I check if a result set’s entities have non-empty properties?
# Oct 17th 2019, 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.
# Oct 17th 2019, 15:21 ricksaccous yeah but it slows down queries though :(
# Oct 17th 2019, 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.
# Oct 17th 2019, 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
# Oct 17th 2019, 14:50 mrfeedback yes I am absolutely with you
# Oct 17th 2019, 14:46 hippo might not matter but it's good to be careful
# Oct 17th 2019, 14:45 francis.nadal @admad I figured it out thanks hehe
# Oct 17th 2019, 14:44 mrfeedback hmm thanks for the hint!
# Oct 17th 2019, 14:44 mrfeedback true story
# Oct 17th 2019, 14:44 hippo yeah until someone upgrades mysql
# Oct 17th 2019, 14:44 hippo or thats what id' do at least
# Oct 17th 2019, 14:44 mrfeedback i just tested it. its turned off on the server
# Oct 17th 2019, 14:44 hippo like adding in a check to see if it's disabled in bootstrap
# Oct 17th 2019, 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
# Oct 17th 2019, 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?
# Oct 17th 2019, 14:37 mrfeedback i have to admit db is just an untouched mysql 5.7 docker container
# Oct 17th 2019, 14:37 mrfeedback hmm so you think i should turn it off?