CakePHP v 2.9.1. I have two tables that are joined with a HABTM relationship. The id field of one table is CHAR(1), the other is CHAR(3). This is quite acceptable, I believe. Saving HABTM data is failing because line 2040 of Model.php checks: if string and length = 36 or 16 - then save, else don’t save. By the time it’s got here any existing HABTM relationships have been deleted. Interested to know why this restriction is there, and more importantly how I can work around this (without remodelling my data structure or creating a through model).
Related topics
Topic | Replies | Views | Activity | |
---|---|---|---|---|
HABTM With 3 keys | 0 | 588 | September 22, 2016 | |
Cannot convert value of type string to integer when joining multiple tables | 11 | 3751 | January 25, 2022 | |
[SOLVED] “Cannot convert value to string” when retreiving data (belongsToMany relationship) | 0 | 3048 | October 19, 2016 | |
Cannot save associated table | 4 | 546 | August 16, 2020 | |
CakePHP3.4: strange error on a query about a particular HABTM association [SOLVED] | 1 | 819 | April 26, 2017 |