# |
Nov 28th 2017, 15:41 |
admad |
even use entered value should be cleaned |
# |
Nov 28th 2017, 15:41 |
neon1024 |
Well that’s either (a) Their funeral or (b) Caught by userland slug validation rule |
# |
Nov 28th 2017, 15:40 |
admad |
what if the value is unique but user has entered crap in the string like space chars? |
# |
Nov 28th 2017, 15:40 |
neon1024 |
Does that make sense? |
# |
Nov 28th 2017, 15:40 |
neon1024 |
But if the value is empty, the slugger would make a slug |
# |
Nov 28th 2017, 15:40 |
neon1024 |
To allow more granular implementation based on the existing entity value |
# |
Nov 28th 2017, 15:39 |
neon1024 |
So it’s decoupling the rules and validation from the actual slugging |
# |
Nov 28th 2017, 15:39 |
neon1024 |
As the value would be a slug, but user input |
# |
Nov 28th 2017, 15:39 |
neon1024 |
It wouldn’t slug the value, but instead just check it’s a valid slug |
# |
Nov 28th 2017, 15:38 |
neon1024 |
@admad No, the opposite of that, by about 35% |
# |
Nov 28th 2017, 15:38 |
johnwayne |
Does anybody use DataTables with cakePhp (pagination, filters etc.)? |
# |
Nov 28th 2017, 15:38 |
admad |
@neon1024 so you want the slugger to run even when you have preset a value for the slug field? |
# |
Nov 28th 2017, 15:37 |
neon1024 |
Just use `->count()` ? |
# |
Nov 28th 2017, 15:29 |
hugobapgomes |
hey guys, is it possible to do a query with ->group([*]) and somewhere returns an count of the grouped items? |
# |
Nov 28th 2017, 15:07 |
neon1024 |
As above. |
# |
Nov 28th 2017, 15:07 |
birdy247 |
what was the problem? |
# |
Nov 28th 2017, 15:06 |
neon1024 |
Might make an RFC for that so ADmad can close it |
# |
Nov 28th 2017, 15:06 |
neon1024 |
Would be nice if it looked for the field, and if it wasn’t in the post data, or was empty it generated a slug and if it wasn’t then it just used what was posted, but still checked for uniqueness |
# |
Nov 28th 2017, 15:05 |
neon1024 |
Where is Jadb anyway?! |
# |
Nov 28th 2017, 15:04 |
neon1024 |
That would be a good place to use Muffin/Slug! |
# |
Nov 28th 2017, 15:04 |
neon1024 |
:s |
# |
Nov 28th 2017, 15:04 |
neon1024 |
How to obscure your validation messages from both the request data and model layer |
# |
Nov 28th 2017, 15:03 |
neon1024 |
That’ll do it `$content->set('slug', Text::slug(strtolower($content->get('title'))));` |
# |
Nov 28th 2017, 15:03 |
neon1024 |
Ahhh |
# |
Nov 28th 2017, 15:02 |
neon1024 |
File uploaded https://cakesf.slack.com/files/U1BT622HW/F87J3492T/geterrors.txt / https://slack-files.com/T053DPNCM-F87J3492T-9336422a3b |
# |
Nov 28th 2017, 15:01 |
neon1024 |
I just get this, |
# |
Nov 28th 2017, 15:01 |
neon1024 |
Would be nice if Muffin/Slug worked with manually edited fields |
# |
Nov 28th 2017, 15:00 |
slackebot2 |
Action: neon1024 sulks |
# |
Nov 28th 2017, 15:00 |
neon1024 |
This is what you get when the product manager wants to edit their own slugs |
# |
Nov 28th 2017, 14:59 |
neon1024 |
..and I doubt that `$rules->add($rules->isUnique(['slug'], 'Slug already exists.'));` is going to yield any clues :( |
# |
Nov 28th 2017, 14:59 |
neon1024 |
I can hardly paste in a 350 line template |
# |
Nov 28th 2017, 14:59 |
neon1024 |
What code? |
# |
Nov 28th 2017, 14:58 |
birdy247 |
add your code on slack |
# |
Nov 28th 2017, 14:57 |
neon1024 |
It is |
# |
Nov 28th 2017, 14:57 |
birdy247 |
sounds like one of those "too close to see it" bugs |
# |
Nov 28th 2017, 14:56 |
birdy247 |
gist |
# |
Nov 28th 2017, 14:56 |
neon1024 |
Nope |
# |
Nov 28th 2017, 14:56 |
birdy247 |
@neon1024 using a plugin? |
# |
Nov 28th 2017, 14:55 |
birdy247 |
I thought it was supposed to be cleared automatically from time to time |
# |
Nov 28th 2017, 14:55 |
birdy247 |
My debug.log file is growin massive again |
# |
Nov 28th 2017, 14:44 |
neon1024 |
Why am I getting a validation error for an slug not being unique, when it is unique? |