# |
Jan 20th 2020, 09:39 |
challgren |
Whats your request data look like? |
# |
Jan 20th 2020, 09:39 |
HumanG33k |
the entity is save without my data |
# |
Jan 20th 2020, 09:39 |
challgren |
But your saying its not saving the data, correct? |
# |
Jan 20th 2020, 09:38 |
HumanG33k |
@challgren $country->getErrors() is an empty array |
# |
Jan 20th 2020, 09:37 |
javier.villanueva |
morning all |
# |
Jan 20th 2020, 09:32 |
challgren |
Id say put it around line 8 |
# |
Jan 20th 2020, 09:32 |
challgren |
does debug($country->getErrors()) output anything? |
# |
Jan 20th 2020, 09:31 |
HumanG33k |
@challgren all exept id |
# |
Jan 20th 2020, 09:28 |
challgren |
Yep, what fields do you have accessible in the CountryEntity |
# |
Jan 20th 2020, 09:27 |
HumanG33k |
because i have the same behavior |
# |
Jan 20th 2020, 09:25 |
HumanG33k |
https://paste.debian.net/1126762/ @challgren like that ? |
# |
Jan 20th 2020, 09:22 |
turkles |
Argh, why is dealing with HABTM so hard? Why can't I index by contain in v3.8? Why can't I easily add/remove entities and then save at the end :S |
# |
Jan 20th 2020, 09:17 |
turkles |
https://book.cakephp.org/4/en/orm/saving-data.html#merging-request-data-into-entities for v4, but it is samesame ;) |
# |
Jan 20th 2020, 09:16 |
challgren |
https://book.cakephp.org/3/en/orm/saving-data.html#merging-request-data-into-entities |
# |
Jan 20th 2020, 09:15 |
challgren |
You need a patchEntity() in there humang33k |
# |
Jan 20th 2020, 09:15 |
HumanG33k |
do you need i had my curl request ? |
# |
Jan 20th 2020, 09:14 |
HumanG33k |
https://paste.debian.net/1126759/ and https://paste.debian.net/1126761/ |
# |
Jan 20th 2020, 09:11 |
marek.sebera |
Since docs lack the info, is Datasource "persistent" setting enabling this PHP feature? https://www.php.net/manual/en/features.persistent-connections.php |
# |
Jan 20th 2020, 09:10 |
slackebot |
!gist |
# |
Jan 20th 2020, 09:09 |
slackebot |
Command sent from Slack by challgren: |
# |
Jan 20th 2020, 09:09 |
HumanG33k |
let me paste code/output |
# |
Jan 20th 2020, 09:08 |
turkles |
if you debug() your entity before you try to save does it have errors then? |
# |
Jan 20th 2020, 09:07 |
HumanG33k |
the id and created, updated are well created and data are well receive too @turkles |
# |
Jan 20th 2020, 09:06 |
HumanG33k |
the key ? |
# |
Jan 20th 2020, 09:04 |
turkles |
HumanG33k - probably missing the key? |
# |
Jan 20th 2020, 09:03 |
mr.kusmadi |
@conehead OK Thank you hehe |
# |
Jan 20th 2020, 08:52 |
HumanG33k |
hello when i submit my json/curl request to add action the book code don t want to merge entity. some of you already as that issue ? (on v4) |
# |
Jan 20th 2020, 06:58 |
slackebot |
https://github.com/cakephp/authentication/blob/master/src/Identifier/Resolver/OrmResolver.php Probably it is enough to loop through $this->_config['userModels'] and use the existing code and return the result only if any was found. |
# |
Jan 20th 2020, 06:58 |
conehead |
@mr.kusmadi Where did you see that it works with multiple models at all? As @ricksaccous said you probably will need your own resolver. Not changing some variables, but writing a whole resolver yourself and use it like: ``` 'resolver' => [ 'className' => 'Authentication.YourOwnOrm', 'userModels' => ['Admin','Users','Students'], ],``` Have a look at |
# |
Jan 20th 2020, 03:20 |
slackebot |
'all', ];``` no userModels in there help me out thx |
# |
Jan 20th 2020, 03:20 |
mr.kusmadi |
``` //this code successfull 'resolver' => [ 'className' => 'Authentication.Orm', 'userModels' => ['Admin','Users','Students'], ],``` he will automatically recognize the users table as a model table app/vendor/cakephp/authentication/src/Identifier/Resolver/OrmResolver.php online 37 ``` protected $_defaultConfig = [ 'userModel' => 'Users', 'finder' => |
# |
Jan 20th 2020, 00:34 |
ricksaccous |
then your own resolver is probably the way to go |
# |
Jan 20th 2020, 00:34 |
ricksaccous |
if you want to accept any of those tables though |
# |
Jan 20th 2020, 00:34 |
ricksaccous |
if that's the case you might as well just not make resolvers and instead set the resolver based on the request |
# |
Jan 20th 2020, 00:34 |
ricksaccous |
are you just trying to set one per login page though |
# |
Jan 20th 2020, 00:34 |
ricksaccous |
@mr.kusmadi change 'userModel' to 'userModels' and have your resolver read that setting |
# |
Jan 20th 2020, 00:33 |
mr.kusmadi |
@ricksaccous I already made a resolver. Was successful How to set multi tables ``` //this code successfull 'resolver' => [ 'className' => 'Authentication.Orm', 'userModel' => 'Admin', ],``` |
# |
Jan 19th 2020, 23:29 |
lpj145 |
@challgren thanks! |
# |
Jan 19th 2020, 23:24 |
ricksaccous |
but i'm not sure if that will turn out well |
# |
Jan 19th 2020, 23:24 |
ricksaccous |
you can even possibly load a single resolver with different params based on request |
# |
Jan 19th 2020, 23:23 |
ricksaccous |
that supports multiple tables |