Digging around today because I had a problem with CakePHP holding on to old values in a multi select that was used to maintain a HABTM relationship. The issue was that I could add items fine, but it never deleted old items in the select list.
I’d obviously overlooked one of the key points that is explained in a bug note I found on the topic:
#3939 (HABTM association save not working properly) – CakePHP : The Rapid Development Framework for PHP – Trac:
Cake only does a delete on all HABTM links if the ‘unique’ property of the association is set to true (this should, however, be the default). If updating to the branch code and manually setting the association property do not fix this, please submit a diff against the model test case that proves the issue.
