# |
May 12th 2021, 13:33 |
neon1024 |
Apologies for being a pain, but what is this? `_Token was not found in request data.` I can see a hidden `_Token` field with debug token, fields token and such |
# |
May 12th 2021, 11:31 |
neon1024 |
Knowing Cake, I’m sure one of the Army of Marks will have updated it by now :,) |
# |
May 12th 2021, 11:30 |
ndm |
Oh and that, yeah |
# |
May 12th 2021, 11:30 |
ndm |
Yeah, it should probably say `FormProtector` component |
# |
May 12th 2021, 11:30 |
neon1024 |
It’s `FormProtectionComponent` |
# |
May 12th 2021, 11:30 |
neon1024 |
Urk, that PR has a typo |
# |
May 12th 2021, 11:29 |
neon1024 |
Seems my afternoon has a twist! |
# |
May 12th 2021, 11:29 |
neon1024 |
> Error Create the class FormProtectorComponent below in file: src/Controller/Component/FormProtectorComponent.php |
# |
May 12th 2021, 11:29 |
neon1024 |
:,) |
# |
May 12th 2021, 11:27 |
neon1024 |
Awesome! :clap: |
# |
May 12th 2021, 11:27 |
ndm |
The message has been improved recently. https://github.com/cakephp/cakephp/pull/15502/files |
# |
May 12th 2021, 11:26 |
neon1024 |
I wonder if the friendsofcake/bootstrap-ui form helper and crud support this properly :thinking_face: |
# |
May 12th 2021, 11:25 |
neon1024 |
It’s not a very helpful exception message to my brain. As my form does have create first :thinking_face: |
# |
May 12th 2021, 11:24 |
neon1024 |
Ah we meet again Mr Bond :raised_hands: |
# |
May 12th 2021, 08:48 |
neon1024 |
Just a random thought, but is it possible to have the router cast integer id values into `int` instead of passing them to my controller methods as `string` ? `function index(string $id){ ` seems a bit odd to me when I am using strict types. Or is this more of a job for a custom router class I’d create? |
# |
May 12th 2021, 08:34 |
erwane |
i always get fresh data in AppController::beforeFilter(). SQL queries are very fast and this prevent any "why it's not updated ??" |
# |
May 12th 2021, 08:20 |
hello106 |
Ah found it `_$this_->Authentication->setIdentity($user);` - couldn’t see that in the main docs anywhere, except within the migration notes (https://book.cakephp.org/authentication/2/en/migration-from-the-authcomponent.html) |
# |
May 12th 2021, 08:14 |
hello106 |
Hi all, could anyone guide me on how you can/should update an identity with newer data (using the Authentication plugin) if say a user update their name/avatar in their profile? We’re using the standard Identity object (https://book.cakephp.org/authentication/2/en/identity-object.html) - thanks |
# |
May 12th 2021, 08:08 |
naresh.thakur1987 |
I tried both ways |
# |
May 12th 2021, 08:08 |
admad |
Your are calling a non https url from a page with https. |
# |
May 12th 2021, 08:07 |
naresh.thakur1987 |
the code is replica |
# |
May 12th 2021, 08:07 |
naresh.thakur1987 |
I am facing issue on the this sub domain |
# |
May 12th 2021, 08:07 |
naresh.thakur1987 |
on the another sub domain I don't have ssl and it works perfect. |
# |
May 12th 2021, 08:04 |
conehead |
And this does not happen if you do not use ssl? |
# |
May 12th 2021, 08:02 |
naresh.thakur1987 |
```Warning (2): exif_imagetype(http://inventory.dondoca.com/img/products/140-0-thumbnail.jpg): failed to open stream: Connection timed out [APP/Controller/Component/ImageComponent.php, line 16]``` |
# |
May 12th 2021, 08:01 |
conehead |
What is your issue? You should be able to use SSL without any changes |
# |
May 12th 2021, 07:56 |
naresh.thakur1987 |
Hello All, How to use SSL with CakePHP4. I am facing issue. Can somebody guid me to some document for this? |
# |
May 11th 2021, 21:52 |
ndm |
Might be helpful if _someone_ looks into it some day, having a helpful exception being thrown in case of such a conflicting contain config (assuming it's not a bug) might be nice to have... but yeah, it's probably not going to be me, my todo list is already veeeery long :upside_down_face: |
# |
May 11th 2021, 21:46 |
djinn.vsl |
haha yeah, I know... so I might be lucky not encountering this first. BTW, I made a type (not important) `Measures` is not associated with `Complaints` Since I already made the changes and you told me is a good idea to have different names, I'll leave it this way. If you wan't to dig into the ORM, to see if this can be an improvement it's nice but don't worry about me since you already helped :) |
# |
May 11th 2021, 21:40 |
ndm |
Also, the 3+ ORM is a totally different beast to whatever 2.x was doing, you can't compare their quirks, the 3+ ORM is to the 2.x ORM, what sulfur breathing, winged 10 feet Mars goblins are to the human race ;) |
# |
May 11th 2021, 21:29 |
ndm |
It's probably got to do with the nested users being handled by a separate eager loader instance. |
# |
May 11th 2021, 21:24 |
slackebot |
right now, I'd have to try to replicate your association setup first and dig through the ORM source. |
# |
May 11th 2021, 21:24 |
ndm |
Well, the associations are not the same, `Complaints` is `hasOne`, and `Measures` is `hasMany`, the latter type of association is being retrieved in a separate query, so that probably explains the difference in behavior, as the nested users related config and stuff wont clash with other identical association names for the same query. What exactly makes the `belongsToMany` users affect the `hasOne > belongsTo` users, I can't tell |
# |
May 11th 2021, 20:58 |
djinn.vsl |
Been working with Cake since 2.x and this never happened to me. (even doing worse practices than I might be doing now) |
# |
May 11th 2021, 20:56 |
slackebot |
```$this->Proceedings->get($id)->contain(['Users', 'Measures' => ['Users'], 'Complaints' => ['Users']]); //output Proceedings ->users[] <--- OK ->measures ->user <--- OK ->complaints -> <--- NO USER!!!``` ```$this->Proceedings->get($id)->contain(['Measures' => ['Users'], 'Complaints' => ['Users']]); //output Proceedings ->measures ->user <--- OK ->complaints ->user <--- OK``` |
# |
May 11th 2021, 20:56 |
slackebot |
belongsTo Proceedings (proceeding_id) belongsTo Users (user_id) Users belongsTo Proceedings (proceeding_id) ---- I also tried 'hasMany' with same result. hasMany Measures (user_id) hasMany Complaints (user_id)``` ```$this->Proceedings->get($id)->contain(['Users', 'Measures' => ['Users']]); //output Proceedings ->users <--- OK ->measures ->users <--- OK``` |
# |
May 11th 2021, 20:56 |
djinn.vsl |
That's what I thought and that's why I changed the association name... but *why in one case it works and not in the other* while the associations are the same: ```Proceedings belongsToMany Users (proceedings_users table) hasMany Measures (proceeding_id) hasOne Complaints (proceeding_id) Measures belongsTo Proceedings (proceeding_id) belongsTo Users (user_id) hasOne Complaints (measure_id) Complaints |
# |
May 11th 2021, 20:21 |
ndm |
You should generally be careful with association names, as tables are only instantiated once per alias, so you could easily create problems like for example cyclic references. Duplicate aliases can also cause problems with join based associations, as aliases must be unique on SQL level, so the ORM will only join them once IIRC. |
# |
May 11th 2021, 20:08 |
djinn.vsl |
Or maybe there's a proper way to get the details of `Proceedings->complaint->user` since I have the same user inside `Proceedings->users[]` but I prefer to let Cake do the job |
# |
May 11th 2021, 19:56 |
slackebot |
not error thrown by Cake and If I call `Complaints->Users` I can see the `Users` but not if, in the same query, I get `Proceedings->Users` Thank you! |
# |
May 11th 2021, 19:56 |
slackebot |
retrieve the following in the same query : ```Proceedings ->users ->measures ->users``` I reverted my changes and try to retrieve `Proceedings->find()->contain(['Users, 'Measures' => ['Users'], 'Complaints' => ['Users', 'Files']);`, I got no users inside `Complaints`: ``` Proceedings ->users ->measures ->users ->complaints ->files <----- no users inside complaints``` *Any idea why?* There is |