
Cakephp Multiple HABTM bug |
| Author: roryy, on 14/4/08 |
| Tags: cakephp, HABTM, bug, |
| Hi do you have problems with your cake model with multiple HABTM fields in cakephp 1.2? It can be the bug in cakephp. Here's the solution. |
| $this->data: [Foo] => Array ( [Foo] => Array ( [0] => 2 ) ) [Bar] => Array ( [Bar] => Array ( [0] => 2 [1] => 3 ) ) This doesn't work without the fix. When you save this cake will add the [foo] to the [bar] table. To fix this you have to edit model.php in /cake/libs/model. Scroll down to function __saveMulti and then look for this line: and add this line before it: The problem is fixed! Good luck. (This is tested in cakephp 1.2 rev 6311) |

