# |
Jul 12th 2017, 14:09 |
jeremyharris |
what about debug($newEntity) at line 8, here: https://gist.github.com/mccp/9c96c20d1890a477761ef96919acb2c3#file-aftersave_inside_behavior-L8 |
# |
Jul 12th 2017, 14:08 |
kim____ |
but doesn't get to that point because $entity is not yet saved. |
# |
Jul 12th 2017, 14:08 |
kim____ |
afterSave is the place where it will be created. |
# |
Jul 12th 2017, 14:07 |
kim____ |
but inside the afterSave, newActivity is not yet created. |
# |
Jul 12th 2017, 14:07 |
kim____ |
https://gist.github.com/mccp/e613e639beb517811e893bec626b3fdc |
# |
Jul 12th 2017, 14:06 |
kim____ |
oh, sorry hold on |
# |
Jul 12th 2017, 14:05 |
jeremyharris |
ok sorry, I think I’m not being clear. Can you gist the output of debug($entity) and debug($newActivity) from the afterSave method on your behavior? I need to see their state at the time that afterSave is called, to see if there are validation errors, to see if the entities were created successfully, etc. |
# |
Jul 12th 2017, 14:03 |
kim____ |
https://gist.github.com/mccp/0f67df8b3af80268baa53749b582fa07 |
# |
Jul 12th 2017, 14:02 |
jeremyharris |
I want to see what afterSave is getting |
# |
Jul 12th 2017, 14:02 |
jeremyharris |
> can you please gist the entity as well as the newActivity entity you gisted the tables :slightly_smiling_face: |
# |
Jul 12th 2017, 14:01 |
kim____ |
that's why i need it in afterSave |
# |
Jul 12th 2017, 14:01 |
kim____ |
newActivity can't be created without the newEntity |
# |
Jul 12th 2017, 14:01 |
kim____ |
https://gist.github.com/mccp/b6a01403bc47d08bdd4fd5be03dd43e7 |
# |
Jul 12th 2017, 13:59 |
jeremyharris |
(I’m just trying to understand your use case) |
# |
Jul 12th 2017, 13:58 |
jeremyharris |
e.g., on beforeSave add $entity->activities = [$newActivity] |
# |
Jul 12th 2017, 13:57 |
jeremyharris |
again, is there a reason you don’t simply add the entity on before save so it’s all saved in a single transaction? |
# |
Jul 12th 2017, 13:57 |
jeremyharris |
can you please gist the entity as well as the newActivity entity |
# |
Jul 12th 2017, 13:56 |
kim____ |
this is the contents of afterSave |
# |
Jul 12th 2017, 13:56 |
kim____ |
https://gist.github.com/mccp/9c96c20d1890a477761ef96919acb2c3 |
# |
Jul 12th 2017, 13:55 |
kim____ |
the afterSave is implemented inside a behavior. |
# |
Jul 12th 2017, 13:52 |
jeremyharris |
can you gist some information, such as the entity that afterSave gets. Is there a reason you aren’t using the ORM’s relationships and just adding the log to the entity on beforeSave? |
# |
Jul 12th 2017, 13:51 |
kim____ |
still the same problem |
# |
Jul 12th 2017, 13:51 |
kim____ |
i also tried to change afterSave to afterSaveCommit |
# |
Jul 12th 2017, 13:48 |
kim____ |
I have a behavior that logs the creation of an entity to a LogsTable. The new log needs a reference to the new entity. So I created an afterSave for the behavior that saves the log. But i get a "Source entity needs to be persisted before proceeding" message. Shouldn't the new entity exist already? |
# |
Jul 12th 2017, 12:41 |
clementcrown |
@casmo, thanks it worksin the .htaccess |
# |
Jul 12th 2017, 12:39 |
clementcrown |
@casmo, thanks, let me try that |
# |
Jul 12th 2017, 12:35 |
casmo |
I'm not sure. Maybe you can try .htaccess? https://stackoverflow.com/questions/949415/overriding-upload-max-filesize |
# |
Jul 12th 2017, 12:34 |
clementcrown |
thanks @casmo i have added array('upload_max_filesize'=>'100000M', 'post_max_size'=>'100000M'); but i still can not upload a file of 5MB, what could be the problem please? |
# |
Jul 12th 2017, 12:30 |
davalb |
@robertpustulka thanks, I will look into that option |
# |
Jul 12th 2017, 12:03 |
casmo |
ini_set in the bootstrap |
# |
Jul 12th 2017, 11:59 |
sauvaget |
Hey guys, there a possibilty to force cakephp to render a view and stop processing the rest of the controller? |
# |
Jul 12th 2017, 11:56 |
clementcrown |
hi guys, can someone tell me where else I can increase the upload limit in cakephp 3 apart from php.ini |
# |
Jul 12th 2017, 11:17 |
robertpustulka |
Maybe use custom validator and patchEntity instead of calling seters explicitly? |
# |
Jul 12th 2017, 11:10 |
davalb |
Is it possible to hook into the set()-method of an entity via a behaviour? (What I want to do is: run a check, before I change an attribute. If that check fails abort the change of the attribute. For reusability-reasons I would like to implement this check in a behaviour instead of in the model) |
# |
Jul 12th 2017, 10:59 |
casmo |
And the default is set in the table of your database, default id if I'm not wrong |
# |
Jul 12th 2017, 10:59 |
casmo |
probably asc |
# |
Jul 12th 2017, 10:40 |
neon1024 |
Which makes me wonder what `->order('name')` might produce |
# |
Jul 12th 2017, 10:40 |
neon1024 |
As I can’t seem to find one |
# |
Jul 12th 2017, 10:39 |
neon1024 |
Also, does `->order()` have a default direction? |
# |
Jul 12th 2017, 10:30 |
neon1024 |
How does the indenting work in Bake templates? If I have 0 indents on my closing `]` I still get 4 indents (4x4 spaces) in my generated controller code |
# |
Jul 12th 2017, 10:26 |
steinkel |
if you are lazy, you have this too > https://gist.github.com/steinkel/70e1051e5a60eea9d2e02839d1fe4345 |