Log message #4030296

# At Username Text
# May 19th, 11:32 crazycoder i have a cell with a form, but i am using this cell inside a page where there are another form...so now how can i avoid conflicts?
# May 19th, 11:32 crazycoder hi
# May 19th, 10:17 unclezoot just did a retest, a blank/unselected vanilla multiselect doesnt appear in the POST when you submit the form
# May 19th, 10:16 Neon1024 It’s a bit more work, but I find the extra verbosity easier to maintain later on in the project
# May 19th, 10:16 unclezoot that's what i used to do on cake2 actually
# May 19th, 10:15 Neon1024 Sorry I can’t help more, I struggle myself with belongsToMany, especially the form data formatting. I tend to not use it these days and instead normalise the associations out into a hasMany <-> belongsTo with a concrete join Table class instance
# May 19th, 10:15 unclezoot thanks for your help anyway
# May 19th, 10:14 unclezoot i know that's what i was hoping myself :)
# May 19th, 10:14 Neon1024 it Just Works (tm)
# May 19th, 10:14 Neon1024 It’s not an issue I’ve ever encountered myself
# May 19th, 10:14 Neon1024 Do try different browsers just in case, and use HTML5 doctype?
# May 19th, 10:14 unclezoot that's what i thought, until i tested some vanilla multiselect html code
# May 19th, 10:13 Neon1024 As that’s what the validation rule notEmpty() is for
# May 19th, 10:13 Neon1024 Posted as in , they key will exist in the post array
# May 19th, 10:13 Neon1024 It should get posted, even if it’s empty
# May 19th, 10:13 unclezoot so from looking at the test, the tester is explicitly setting the tags variable to [], and cake obviously says, ahh this is empty, lets delete first. as i see it, the problem here is that the field just never gets posted, so it's never set to the empty array, so it never gets deleted (unless of course, cake notices it's missing in the first place and assumes it's empty, then deletes it - which i dont think it does)
# May 19th, 10:09 unclezoot ill have a read - thanks
# May 19th, 10:08 Neon1024 unclezoot: https://github.com/cakephp/cakephp/blob/master/tests/TestCase/ORM/TableTest.php#L3916
# May 19th, 10:07 cgundersson that went as expected
# May 19th, 10:07 cgundersson #join #ubuntu
# May 19th, 10:07 Neon1024 If in doubt check the core tests, as there will be a test for this
# May 19th, 10:07 unclezoot an empty array?
# May 19th, 10:06 Neon1024 and ensure the assoctiations are being saved
# May 19th, 10:06 Neon1024 iirc you need to submit an empty association
# May 19th, 10:05 unclezoot i can explicitly set the strategy to replace and retest my baked code i suppose
# May 19th, 10:05 unclezoot hmm i was testing with baked code, which suggests the replace strategy was automatically configured? the code still didnt remove the join table records when the missing form input was posted
# May 19th, 10:04 Neon1024 https://book.cakephp.org/3.0/en/orm/associations.html#belongstomany-associations
# May 19th, 10:04 Neon1024 If you’re using the ‘append’ saveStrategy then you’ll just be adding new records and old ones will persist
# May 19th, 10:04 Neon1024 unclezoot: If the belongsToMany is configured with the ‘replace’ saveStrategy which is default, then yes, on update it will remove all join records and insert new ones. If none exist in the submitted data, they will just be removed
# May 19th, 09:50 unclezoot ng at all...
# May 19th, 09:50 unclezoot Question: if your form has a multi-select (handled by a belongsToMany association) and, when editing, you deselect your previous selections completely leaving nothing and submit the form, that input simply doesnt exist in the POST which seems to be standard HTML (from my tests). My question then is, should cake3 realise that the input is missing and remove all the existing records in the join table? because that doesn't seem to be happeni
# May 19th, 09:40 crazycoder i ahve a cell with a form, but i am using this cell inside a page where there are another form...so now how can i avoid conflicts?
# May 19th, 09:40 crazycoder hello everybody
# May 19th, 09:04 slackebot !google Cakephp cookbook
# May 19th, 09:04 slackebot Command sent from Slack by hiromi2424:
# May 19th, 09:03 metoyoko @hiromi2424 may I know the link thanks.
# May 19th, 09:03 eax Hey folks - Any news on when 3.4.7 is released? :)
# May 19th, 09:02 metoyoko but the result from controller was not json_encoded, I already handle this in ver. cakephp 2 using $this->layout = "ajax"; but in cakephp 3.4 it didnt work
# May 19th, 09:01 hiromi2424 @metoyoko you should see cookbook first
# May 19th, 09:00 Neon1024 I already have a job thanks :p
# May 19th, 09:00 Neon1024 No! Write your own code! What a cheek