Log message #4044969

# At Username Text
# Jun 27th 2017, 16:01 neon1024 The rule is run as I can change the error validation message and it’s respected in the entity
# Jun 27th 2017, 16:01 neon1024 But does add an error message in the entity
# Jun 27th 2017, 16:00 neon1024 Never gets to there
# Jun 27th 2017, 16:00 neon1024 `->requirePresence('package_id', function ($context) { var_dump($context);exit;`
# Jun 27th 2017, 16:00 jeremyharris shortcut for debug then die
# Jun 27th 2017, 16:00 neon1024 I have no idea what dd() is
# Jun 27th 2017, 15:54 jeremyharris I’ve debugged it before okay. are you sure you’re satisfying the `when` condition? can always try `dd()`
# Jun 27th 2017, 15:49 neon1024 I have no idea how $context is created here, https://github.com/cakephp/cakephp/blob/master/src/Validation/Validator.php#L703
# Jun 27th 2017, 15:47 neon1024 Where can I see the $context from the validation methods in the core? I can’t seem to var_dump() it in my ‘when’ / ‘mode’ callback methods
# Jun 27th 2017, 15:39 jeremyharris yep, thanks for working on a test case :slightly_smiling_face: will help a lot of other people if it is indeed a bug
# Jun 27th 2017, 15:38 elboletaire thanks for the time buddies :slightly_smiling_face:
# Jun 27th 2017, 15:38 elboletaire so, I'll try to do that... create a project to reproduce this issue (and others I've found related to this)
# Jun 27th 2017, 15:37 elboletaire it's a very huge project, but I've tried disabling all the behaviors from both tables without any change on the save process...
# Jun 27th 2017, 15:37 jeremyharris that’s probably a good idea. if you can create a failing test case I’d be happy to work on a fix
# Jun 27th 2017, 15:37 jeremyharris yeah
# Jun 27th 2017, 15:37 jeremyharris is there anything unconventional about your table setup
# Jun 27th 2017, 15:37 elboletaire I'll try to create a really simple project with all these entities, and try to reproduce the steps there, so I can open an issue
# Jun 27th 2017, 15:36 jeremyharris oy
# Jun 27th 2017, 15:36 elboletaire reverse doesn't work either...
# Jun 27th 2017, 15:36 jeremyharris either way, it shouldn’t return true if it’s not saving, so there might be a bug somwehere
# Jun 27th 2017, 15:36 elboletaire I'm trying..
# Jun 27th 2017, 15:35 jeremyharris while this shouldn’t matter, have you tried the reverse? `$this->Users->link($role, [$users])`
# Jun 27th 2017, 15:34 elboletaire nope, same result :(
# Jun 27th 2017, 15:33 elboletaire nope, let me try
# Jun 27th 2017, 15:33 jeremyharris have you tried saving a single user instead of looping? I wonder if there’s some state bug
# Jun 27th 2017, 15:32 jeremyharris (I’m reading through the code atm)
# Jun 27th 2017, 15:32 jeremyharris I feel ya
# Jun 27th 2017, 15:32 elboletaire exactly that's how I've been the latest two ours...
# Jun 27th 2017, 15:31 jeremyharris hrm
# Jun 27th 2017, 15:31 elboletaire `replace`
# Jun 27th 2017, 15:30 jeremyharris what’s the saveStrategy?
# Jun 27th 2017, 15:30 elboletaire no relations are touched... the original relations remain the same
# Jun 27th 2017, 15:30 elboletaire in fact
# Jun 27th 2017, 15:30 elboletaire so both apparently are saving, but no relations are stored
# Jun 27th 2017, 15:30 elboletaire the link returns true, the `save` (using `set`) returns the entity
# Jun 27th 2017, 15:29 jeremyharris wait you said it’s returning true and fails to save?
# Jun 27th 2017, 15:29 jeremyharris also check the table rules
# Jun 27th 2017, 15:29 jeremyharris perhaps pepper the core with some debug statements, that’d be my next step. specifically where it returns false. one might be failing for some strange reason
# Jun 27th 2017, 15:28 elboletaire ofc
# Jun 27th 2017, 15:27 jeremyharris I’m assuming you debugged roles and users, and they have content
# Jun 27th 2017, 15:26 jeremyharris yeah actually; scratch that idea