-
MODX Staff
- 730 Posts
Can you post or pastebin your schema?
-
MODX Staff
- 730 Posts
I think you should omit $setPrimaryKeys from ->fromArray or set it to false:
$slideAlbum->fromArray($input_data,'');
-
☆ A M B ☆
- 181 Posts
Thanks, but it did not effect the save().
-
MODX Staff
- 730 Posts
Are you looking in the modx error log for messages?
Reports > Error Log
(or core/cache/logs/error.log)
-
☆ A M B ☆
- 181 Posts
I looked in Reports->Error Log, I did not know to look for a file log.
Anyway I did find out what my code problem was. I did not state all of the db columns in fromArray(), one that was set to NOT NULL. Once I put that in the fromArray() it worked. But I don’t get why I did not get an error/warning message telling me that I need to add every NOT NULL value in the insert. I have MySQL 5.5.8.
Thanks for the help.
A small side note, you can always access your logs via /core/cache/logs/error.log in your browser. It’s a bit more handy then using the textarea within MODx.
Also, validating your object before saving is always a good idea. Sometimes it simply returns NULL and using object modifiers will get you into all sorts of trouble. I usually like to validate it as !is_null($object) and is_object($object).
@MarkGHErnst
Developer at Adwise Internetmarketing, the Netherlands.