Log message #4222184

# At Username Text
# Jan 13th 2020, 16:24 ndm fyi, all `allowEmpty*` methods do allow `null`
# Jan 13th 2020, 16:23 phantomwatson So you'd recommend adding `allowEmptyString()` and having the value saved as `'field' => $value ?? ''`? It feels hacky, but it's ultimately just six more characters, so not a huge deviation from what I was originally doing.
# Jan 13th 2020, 16:20 dereuromark the API is an issue for sure these days. I keep the old ones with deprecations silenced for usability.
# Jan 13th 2020, 16:20 dereuromark mainly the "As request data is all strings" only being partially the case, even thow most of the time. @neon1024 is still right about the approach.
# Jan 13th 2020, 16:19 dereuromark Nah, I was just adding a remark :) All good.
# Jan 13th 2020, 16:18 neon1024 I’ve kept the deprecation errors :zipper_mouth_face:
# Jan 13th 2020, 16:18 phantomwatson Whoops, didn't mean to open up a can of works. :)
# Jan 13th 2020, 16:18 neon1024 I’ll hand over to @dereuromark he’ll have a much better idea of it than I will 8)
# Jan 13th 2020, 16:17 dereuromark which is not even true, some can come in via API, and will not be strings. I pointed out before this should have been allowEmptyScalar() if anything.
# Jan 13th 2020, 16:17 neon1024 So you might want allowEmptyString and isNumeric
# Jan 13th 2020, 16:17 neon1024 As request data is all strings, perhaps it’s just allow string
# Jan 13th 2020, 16:17 neon1024 https://api.cakephp.org/3.8/class-Cake.Validation.Validator.html#_allowEmptyString
# Jan 13th 2020, 16:17 neon1024 Man, I hate the validation now
# Jan 13th 2020, 16:16 neon1024 Ah, just a missing method
# Jan 13th 2020, 16:16 phantomwatson In the Validator class?
# Jan 13th 2020, 16:16 neon1024 It’s in 3.x
# Jan 13th 2020, 16:16 phantomwatson Is `allowEmptyInteger()` something in CakePHP 4? I'm not seeing it in 3.
# Jan 13th 2020, 16:15 phantomwatson I don't think there's anything wrong with the methods that I mentioned.
# Jan 13th 2020, 16:14 neon1024 The test cases might shed some light
# Jan 13th 2020, 16:14 neon1024 I don’t think it enforces a type when not empty, although the method name would lead me to think it would
# Jan 13th 2020, 16:14 neon1024 As for the question, I think allowEmptyInteger with boolean controls empty
# Jan 13th 2020, 16:13 neon1024 For most of the reasons you’ve pointed out
# Jan 13th 2020, 16:13 neon1024 The API is garbage now
# Jan 13th 2020, 16:13 neon1024 Validation? Nope. :hankey: :fire:
# Jan 13th 2020, 16:12 slackebot types. `->requirePresence('fieldname', false)` would cover the condition of the field not being present in the data array, but I want to avoid tripping any validation errors if it _is_ present and `null`. Anyone have any advice?
# Jan 13th 2020, 16:12 phantomwatson I'm somehow forgetting a basic validation thing for CakePHP 3. If a field is a nullable integer field, does `$validator->integer('fieldname')` cover that, or is an `->allowEmptyFoo()` rule also necessary? With `allowEmpty()` being deprecated, I forget what the equivalent is of "allow null values". `Validation::isInteger()` looks like it would fail for `null`, but the `allowEmptyFoo()` methods seem to all expect empty values of non-null
# Jan 13th 2020, 16:09 dereuromark keep the side effects minimal.
# Jan 13th 2020, 16:09 dereuromark then isolate it to the controllers and actions.
# Jan 13th 2020, 16:08 ckjksl Partially our fault. We never got samples of truly large entities during our coding process (and we still don't). The entities the users are trying to duplicate are fairly involving. I'm not saying we can't split it up and defer it to background tasks, but right now, the users just need more memory while we work on and test a long term fix.
# Jan 13th 2020, 16:04 dereuromark the question for me would be: why is the memory needed and couldnt this be async/deferred to background tasks? you usually also face other issues here as side effects, e.g. nginx repsonse time limit etc.
# Jan 13th 2020, 15:59 ckjksl or would it be in like, `app.php` or `bootstrap.php`?
# Jan 13th 2020, 15:58 ckjksl I guess what I mean is, would it be in the controller method where the expensive actions are happening? there are two places where it duplicates some fairly involving entities (and its associated data).
# Jan 13th 2020, 15:58 neon1024 As opposed to that super fast extra special memory ;)
# Jan 13th 2020, 15:56 dereuromark pages I mean
# Jan 13th 2020, 15:56 dereuromark normal apps should work with normal memory
# Jan 13th 2020, 15:56 dereuromark only where needed :)
# Jan 13th 2020, 15:55 ckjksl I'm having trouble with memory usage, and the general consensus is to increase the limit (for now). My question is: where should this line go: ```ini_set('memory_limit', '512M');```
# Jan 13th 2020, 14:36 ndm There's also a reference to `webroot` in the base `.htaccess` file, but if the webroot is your document root, then that should be irrelevant.
# Jan 13th 2020, 14:35 ndm In `config/paths.php` change the `WWW_ROOT` constant, and in `config/app.php` change the `App.webroot` option.
# Jan 13th 2020, 14:28 cakephp-slack In CakePHP 4, is it possible to rename webroot to private_html? I’m running a project on a host where I (unfortunately) can’t edit the vhost
# Jan 13th 2020, 14:12 neon1024 I read that as “My customer wants to destroy all their SEO credit by generating lots of 404's”