Log message #4030282

# At Username Text
# May 19th 2017, 10:13 Neon1024 Posted as in , they key will exist in the post array
# May 19th 2017, 10:13 Neon1024 It should get posted, even if it’s empty
# May 19th 2017, 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 2017, 10:09 unclezoot ill have a read - thanks
# May 19th 2017, 10:08 Neon1024 unclezoot: https://github.com/cakephp/cakephp/blob/master/tests/TestCase/ORM/TableTest.php#L3916
# May 19th 2017, 10:07 cgundersson that went as expected
# May 19th 2017, 10:07 cgundersson #join #ubuntu
# May 19th 2017, 10:07 Neon1024 If in doubt check the core tests, as there will be a test for this
# May 19th 2017, 10:07 unclezoot an empty array?
# May 19th 2017, 10:06 Neon1024 and ensure the assoctiations are being saved
# May 19th 2017, 10:06 Neon1024 iirc you need to submit an empty association
# May 19th 2017, 10:05 unclezoot i can explicitly set the strategy to replace and retest my baked code i suppose
# May 19th 2017, 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 2017, 10:04 Neon1024 https://book.cakephp.org/3.0/en/orm/associations.html#belongstomany-associations
# May 19th 2017, 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 2017, 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 2017, 09:50 unclezoot ng at all...
# May 19th 2017, 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 2017, 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 2017, 09:40 crazycoder hello everybody
# May 19th 2017, 09:04 slackebot !google Cakephp cookbook
# May 19th 2017, 09:04 slackebot Command sent from Slack by hiromi2424:
# May 19th 2017, 09:03 metoyoko @hiromi2424 may I know the link thanks.
# May 19th 2017, 09:03 eax Hey folks - Any news on when 3.4.7 is released? :)
# May 19th 2017, 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 2017, 09:01 hiromi2424 @metoyoko you should see cookbook first
# May 19th 2017, 09:00 Neon1024 I already have a job thanks :p
# May 19th 2017, 09:00 Neon1024 No! Write your own code! What a cheek
# May 19th 2017, 09:00 metoyoko may I have sample codes? thanks
# May 19th 2017, 09:00 metoyoko @neon1024 with callback result?
# May 19th 2017, 08:56 Neon1024 The way I ajax updated my tables, was to make the table row an element, then us ajax to hit a controller action, which rendered data, and returned row element html which I just inserted into the dom
# May 19th 2017, 08:54 metoyoko or result
# May 19th 2017, 08:54 metoyoko ajax with response
# May 19th 2017, 08:53 metoyoko Hi All, Using Cakephp 3.4, how to implement ajax. because i want to update table rows without submit and refresh page
# May 19th 2017, 08:53 birdy247 Ok thanks Neon1024
# May 19th 2017, 08:46 Neon1024 The code probably needs to be refactored, possibly into a component which can be attached to both controllers
# May 19th 2017, 08:45 Neon1024 In my opinion it is. It’s indicative of a code smell, arising from bad software design
# May 19th 2017, 08:43 birdy247 Is it a bad idea to call one controller action from another controller action??
# May 19th 2017, 08:18 igreat @robertpustulka thanks, found out it wasn't loaded in the autoload of the composer. It's working fine now
# May 19th 2017, 07:52 abc__ hii
# May 19th 2017, 07:41 abc__ anybody :D