Log message #4125179

# At Username Text
# Mar 15th 2018, 05:39 ksandeep_ Hello friends, I need help in tree behavior with scope attribute
# Mar 15th 2018, 01:01 savant im also new here
# Mar 15th 2018, 00:03 rexb new here
# Mar 14th 2018, 18:49 alexmax Actually wait, the schema doesn't need the field.
# Mar 14th 2018, 18:48 generitter Anyone know how to limit actions (scaffold.actions) on associated objects for the “view” action?
# Mar 14th 2018, 18:44 alexmax Is there an easier way?
# Mar 14th 2018, 18:44 alexmax but instead I have to create a field in the schema, and make sure it's in my form, hidden, and contains a value.
# Mar 14th 2018, 18:43 alexmax I'd love to be able to just pop a validation in the validator that just fires without having to be tied to a specific field.
# Mar 14th 2018, 18:39 alexmax I'm having to create a custom field that contains some bunk value in order for my custom validation to fire.
# Mar 14th 2018, 18:23 xinobi How can i solve this problem in order to serve all within /users/:action ?
# Mar 14th 2018, 18:23 xinobi I'm using a modeless form validator, I don't know how to put this but I need to serve Users and Teams requests but both are Users so that leaves me with some architecture trouble at the controller/view domain
# Mar 14th 2018, 18:20 xinobi I've wrote this class https://pastebin.com/fJVuJnvW in order to allow multiple model Authentication and it works quite well
# Mar 14th 2018, 18:12 alexmax `<input type="hidden" name="pubs" value=""/><div class="checkbox"></div><div class="checkbox"></div><div class="checkbox"></div>`
# Mar 14th 2018, 18:12 alexmax ``` $this->Form->select('pubs', ['x' => 'X', 'y' => 'Y', 'z' => 'Z', ], [ 'multiple' => 'checkbox', ]); ```
# Mar 14th 2018, 18:10 alexmax I bet my old version of CakePHP 3.2.9 might be the cause of some of these problems.
# Mar 14th 2018, 18:09 alexmax Great, `multiple => checkbox` doesn't render any checkboxes to the page, only the containing divs.
# Mar 14th 2018, 18:00 meder i need to cache on a condition - can i just return false in a lambda fed to ->cache?
# Mar 14th 2018, 17:56 alexmax I can validate each individual entry, but I have no way to validate all of the fields as a whole because the error has nowhere to go
# Mar 14th 2018, 17:56 alexmax Ugh, and if I break each selection out into its own checkbox, I now don't have a place to put validation for all five of the checkboxes
# Mar 14th 2018, 17:51 alexmax I have a bunch of checkboxes that I want to have validation over all of them "at least one", which seems like multiselect checkbox would be perfect for. However, some of these checkboxes need a little smidgen of content after the label.
# Mar 14th 2018, 17:50 alexmax Is it possible to pass per-item templateVars to a checkbox multiselect?
# Mar 14th 2018, 17:50 alexmax Hrm
# Mar 14th 2018, 17:18 alexmax I might just novalidate the form
# Mar 14th 2018, 17:17 sssd validation*
# Mar 14th 2018, 17:17 sssd can try reportValidity() also to manully run html5 validaion
# Mar 14th 2018, 17:16 sssd @alexmax try form.checkValidity() to see if form is valid
# Mar 14th 2018, 17:15 jeremyharris the inputs aren’t siblings, fwiw
# Mar 14th 2018, 17:15 jeremyharris yeah it works for me just fine in chrome
# Mar 14th 2018, 17:14 jeremyharris hm I have a checkbox required with a hidden field, let me check it out in chrome
# Mar 14th 2018, 17:13 jeremyharris interesting. I’m surprised we haven’t heard of that issue yet
# Mar 14th 2018, 17:13 alexmax It seems like a shortcoming on Chrome's end. Maybe it keeps a list of all 'names' with required, and then hits the hidden field first when it tries to check for it.
# Mar 14th 2018, 17:12 jeremyharris (since the hidden field is not `required`)
# Mar 14th 2018, 17:12 jeremyharris it should only be trying to focus on the actual checkbox though :thinking_face:
# Mar 14th 2018, 17:12 jeremyharris if you remove the hidden input does it work? `hiddenField => false`
# Mar 14th 2018, 17:11 jeremyharris yeah seems correct
# Mar 14th 2018, 17:11 alexmax As you can see, the visible checkbox is marked required, and the hidden field next to it is not. That seems correct, but Chrome does not appear to like it still.
# Mar 14th 2018, 17:10 alexmax Sorry for the IRC folks who had to put up with my edits.
# Mar 14th 2018, 17:10 alexmax ```<div class="input checkbox required"> <input type="hidden" name="foobar" value="0"> <input type="checkbox" name="foobar" value="1" required="required" id="foobar"> <label for="foobar">Foobar Field</label> <small><a href="">Download Foobar Field</a></small> </div>
# Mar 14th 2018, 17:10 jeremyharris it could be trying to focus on it on submit
# Mar 14th 2018, 17:10 alexmax This is what my checkbox field looks like under the covers. I have changed the markup ever so slightly from the original, but I think it's mostly the same, just in a different order.
# Mar 14th 2018, 17:10 jeremyharris or is there a `required` attr on a hidden element somewhere?