(TL;DR : I extended from Inputfield instead of InputfieldMulti. Still learning...)
Hi,
I'm trying to create my own Fieldtype to go along a custom Inputfield, but I can't manage to get it to work, even though it's almost identical to @ryan's FieldtypeEvents exemple.
For some reason, when I hit save, there is an error saying
PHP Warning: PDO::quote() expects parameter 1 to be string, array given in .../Ateliers-Renens/cms/wire/core/WireDatabasePDO.php:675
Trying to debug by comparing with the initial example behaviour, I can see that my data is properly received / translated in sleepValue() but then in sanitizeValue(), $value returns me an empty instance of my custom class. I attached screenshots showing that for both Fieldtype (the first three dumps are from sleepValue() and the last dump is from sanitizeValue()). I don't know if it has anything to do with my problem, and I must admit that I'm not that fluent in either PHP / SQL (even though ProcessWire makes me learn a lot !).
In the meantime, I am going to go for another solution (just using two regular fields), but I will be glad if someone could help me on this (and make me understand where the problem is !).
Just in case I made a gist : https://gist.github.com/romaincazier/43fb7c0ee1e57395fb9e839039f38100 and attached a zip (MapRoom.zip) if someone wants to install on their side, the Inputfield expect something like "0|1" (0 = room n°0, 1 = 1st floor).
Thanks !