Log message #3942889

# At Username Text
# Oct 5th 2016, 16:54 ypnos with secondary fields I just mean you say you have some fields (second address) that are subject to validation but need not be present. thats all I meant
# Oct 5th 2016, 16:54 ypnos yeah so the thing is
# Oct 5th 2016, 16:48 francky06l Well .. secondary fields ? But can you set allowEmpty in the form for the second address ? This is the problem ... because Addresses is not the main model it's an associated one
# Oct 5th 2016, 16:47 ypnos a combination of rules for the secondary fields with allowEmpty() should be all you need
# Oct 5th 2016, 16:46 ypnos maybe have a look at the tutorial? it has simple validation examples
# Oct 5th 2016, 16:46 francky06l I have been trough the doc already, but did not find a 'simple way' ... I am too new to 3.3
# Oct 5th 2016, 16:44 ypnos http://book.cakephp.org/3.0/en/core-libraries/validation.html
# Oct 5th 2016, 16:43 ypnos you can also use allowEmpty() and an entry containing only blanks might be catched by your validation rules?
# Oct 5th 2016, 16:43 ypnos also think about trimming, related problem
# Oct 5th 2016, 16:42 ypnos to avoid blank fields to fill database fields (i.e. to make the field NULL) you can use a filter method in the model that unsets blank values
# Oct 5th 2016, 16:41 ypnos validation is done in the model and there is a method for default validation (see the docs)
# Oct 5th 2016, 16:39 ypnos francky06l: just add the rules for validity of the secondary address fields and then also add ->allowBlank() for all of them
# Oct 5th 2016, 16:38 francky06l Migrating an app from 2.x to 3.3, People->hasMany('Addresses'), a Form with People and 2 Addresses (notEmpty(zip), notEmpty(street), 1 correct Address is mandatory second one if 'blank' should be ignored. Best way to validate this in 3.3 ? Thanks
# Oct 5th 2016, 16:31 francky06l Hi Bakers,
# Oct 5th 2016, 16:16 neothermic ooh, wait, does cakePHP 2.x support 5.3? My test has the new style arrays in it :S
# Oct 5th 2016, 15:17 acosonic cakenewb: its based on bootstrap
# Oct 5th 2016, 15:16 cakenewb that looks very nice indeed
# Oct 5th 2016, 15:15 cakenewb thanks acosonic and admad(/slackebot)?
# Oct 5th 2016, 15:15 acosonic https://nimbus.everhelper.me/client/notes/share/599402/bxef2xmie4u1ikn3hgc9
# Oct 5th 2016, 15:13 admad cakenewb: so do it async. select2, selectize, chosen all this js plugins have the feature to populate list async
# Oct 5th 2016, 15:13 cakenewb but the remote data seems to be doing just that!
# Oct 5th 2016, 15:13 charolastra me too. generate a simple dropdown list and then apply that JS for a nice search field
# Oct 5th 2016, 15:12 cakenewb thx acosonic, i'll check that. my main concern is performance. it would become quite slow I think whenever they have to load synchronously all addresses on each click of an order
# Oct 5th 2016, 15:11 acosonic cakenewb: I've been using this... https://select2.github.io/
# Oct 5th 2016, 15:10 cakenewb are there examples available on how to do a search help/modal dialog box to search for an existing address which might be linked to a customer, or if it doesn't, create it and jump back into the order with the right address id?
# Oct 5th 2016, 15:09 cakenewb having a select dropdown with 500 entries won't be very useful
# Oct 5th 2016, 15:09 cakenewb for the address part
# Oct 5th 2016, 15:08 cakenewb like order hasmany orderitems; order hasone address; order hasone customer; orderitems hasone product and hasone producttype
# Oct 5th 2016, 15:08 cakenewb and more complex relations etc.
# Oct 5th 2016, 15:07 cakenewb my applications had a few 100 records in all of its lifetime, now we're talking 100+ records per week
# Oct 5th 2016, 15:05 acosonic Well Neon1024, can I PM you?
# Oct 5th 2016, 15:05 Speud1 hi ;)
# Oct 5th 2016, 15:05 Speud1 yes, it's always this kind of error with timestamp
# Oct 5th 2016, 15:05 cakenewb hi
# Oct 5th 2016, 15:03 charolastra aah, your right. one of them isn't a Time object
# Oct 5th 2016, 15:01 Neon1024 Especially so if the field is nullable in the db
# Oct 5th 2016, 15:00 Neon1024 Perhaps as Speud1 said, that one item in your loop isnâ??t actually an object
# Oct 5th 2016, 15:00 Neon1024 If youâ??re outputting it in a list, ensure it has a value
# Oct 5th 2016, 15:00 Neon1024 If timestamp is a DateTime object it should be fine
# Oct 5th 2016, 15:00 Neon1024 Why?
# Oct 5th 2016, 14:54 Speud1 yes change the field name ;)