# |
Jan 23rd 2020, 13:09 |
neon1024 |
Or firstMatch |
# |
Jan 23rd 2020, 13:09 |
neon1024 |
Otherwise I’d need ->first() :face_palm: |
# |
Jan 23rd 2020, 13:09 |
neon1024 |
But casting to array gives it keys I can access :) |
# |
Jan 23rd 2020, 13:08 |
neon1024 |
Well it is a collection |
# |
Jan 23rd 2020, 13:07 |
spriz |
But yeah `$completedCalls` is an array - not a `Collection` |
# |
Jan 23rd 2020, 13:05 |
neon1024 |
@spriz Hm, I totally missed that. Thanks! |
# |
Jan 23rd 2020, 13:05 |
spriz |
we have `->countBy(function (Entity $entity) { return (int)$entity->created->hour(12)->minute(12)->second(0)->format('U') * 1000; })` - So I'd say something is wrong with your `$calls` maybe? |
# |
Jan 23rd 2020, 13:05 |
ndm |
@etibor Realistically, there is no reliable way to check whether a user exists, as @neon1024 suggested, you can use the MX checking functionality of the email validation, it will help to verify that the domain has an MX record, but that doesn't tell you anything about whether the given user/account exists. The only reliable way is to sent a confirmation email, and live with the crap in your DB that you need to clean up regularly. |
# |
Jan 23rd 2020, 13:04 |
spriz |
@neon1024 Looks pretty equal to the example :thinking_face: https://api.cakephp.org/3.8/class-Cake.Collection.CollectionInterface.html#_countBy |
# |
Jan 23rd 2020, 13:02 |
neon1024 |
```$completedCalls = $calls->countBy(function ($call) { return $call->finished !== null ? 'complete' : 'incomplete'; });``` |
# |
Jan 23rd 2020, 13:02 |
neon1024 |
Even though DebugKit is showing the numbers I want to output |
# |
Jan 23rd 2020, 13:02 |
neon1024 |
Mostly about using Collection as Array or can’t convert Collection to String |
# |
Jan 23rd 2020, 13:02 |
neon1024 |
When using Collections countBy, how do I output the data? I am getting lots of errors with the things I’m trying |
# |
Jan 23rd 2020, 13:01 |
neon1024 |
In 3.x |
# |
Jan 23rd 2020, 13:01 |
neon1024 |
Yeah, just use the second param of email validation |
# |
Jan 23rd 2020, 12:56 |
etibor |
is it possible to check an email address if it real e-mail address?i have to send a confirmation email, but if it not valid i dont want to save anything to db |
# |
Jan 23rd 2020, 12:55 |
etibor |
hello mates |
# |
Jan 23rd 2020, 11:18 |
neon1024 |
Ah, I can include regular elements :thumbsup: Apologies, should have TIAS |
# |
Jan 23rd 2020, 11:16 |
neon1024 |
I presume, as they’re an instance of View, I can use Elements? |
# |
Jan 23rd 2020, 11:16 |
neon1024 |
How do I share markup when working in Cell templates? I have some shared HTML in my navigation cells |
# |
Jan 23rd 2020, 10:54 |
mark.mikkelson |
cheers |
# |
Jan 23rd 2020, 10:54 |
ndm |
if your cache isn't cleared properly in debug mode, check your `bootstrap.php`, the config change might be missing: https://github.com/cakephp/app/blob/3.7.1/config/bootstrap.php#L90-L95 |
# |
Jan 23rd 2020, 10:53 |
ndm |
no problem |
# |
Jan 23rd 2020, 10:52 |
mark.mikkelson |
thanks again! |
# |
Jan 23rd 2020, 10:52 |
mark.mikkelson |
clearly the last 4 hours driving my self nuts was the jeffing cache :) |
# |
Jan 23rd 2020, 10:51 |
mark.mikkelson |
i thought in debug mode caches refreshed constantly |
# |
Jan 23rd 2020, 10:51 |
mark.mikkelson |
that was it |
# |
Jan 23rd 2020, 10:51 |
mark.mikkelson |
thanks |
# |
Jan 23rd 2020, 10:51 |
mark.mikkelson |
oh god damn it! |
# |
Jan 23rd 2020, 10:50 |
ndm |
In that case maybe it's your route caching, you are still registering the CSRF middleware, so it might apply it for a cached route... ie clear the cache |
# |
Jan 23rd 2020, 10:50 |
mark.mikkelson |
i did look at this but have no idea how it's being included, without me going back through http and a bunch of other classes I found and commenting out/deleting all the csrf stuff? |
# |
Jan 23rd 2020, 10:48 |
mark.mikkelson |
"message": "Missing CSRF token cookie", "url": "/tickets/update", "code": 403, "file": "\vendor\\cakephp\\cakephp\\src\\Http\\Middleware\\CsrfProtectionMiddleware.php", "line": 196 |
# |
Jan 23rd 2020, 10:48 |
mark.mikkelson |
thanks |
# |
Jan 23rd 2020, 10:48 |
mark.mikkelson |
Oo |
# |
Jan 23rd 2020, 10:47 |
ndm |
may want to check my comment on SO |
# |
Jan 23rd 2020, 10:46 |
mark.mikkelson |
in 3.7 |
# |
Jan 23rd 2020, 10:46 |
mark.mikkelson |
is there somewhere else the CSRF middleware could be being loaded from? |
# |
Jan 23rd 2020, 10:45 |
mark.mikkelson |
anybody able to shed some light on disabling CSRF, it's been driving me nuts for a day now. I've got no CSRF mentioned in my routes.php nor in the applicaiton.php , yet I still get Missing CSRF token cookie when posting data in? |
# |
Jan 23rd 2020, 10:44 |
val |
thanks |
# |
Jan 23rd 2020, 10:43 |
ndm |
@val I tend to forget to tag people |
# |
Jan 23rd 2020, 10:42 |
ndm |
`$joinTable = $PostsTable->Tags->junction()` |