Thanks David - the data is now saving correctly. It was me force adding the foreign_key value in that seemed to cause my problem.
I have now uploaded a logo, and then gone back to change it. Two things happened; (1) although it's now hasOne it added a second row in the db, and (2) I got this error: Warning (2): imagecolorsforindex() [function.imagecolorsforindex]: Color index 235 out of range [APP/plugins/media/libs/mm/src/Media/Process/Adapter/Gd.php, line 295] This occurred when testing a different image to the one I used before. Jeremy Burns Class Outfit Tel: +44 (0) 208 123 3822 Mob: +44 (0) 7973 481949 Skype: jeremy_burns http://www.classoutfit.com On 29 Jun 2011, at 15:41, David Persson wrote: > Hi Jeremy, > > If you want the ClinicProfile to have just one logo define the relation in > the ClinicProfile as a hasOne instead of a hasMany. [1] might help you. > The data array you've provided in your previous post should then start to > work. Because that is correct for using a hasOne but _not_ for a hasMany. > > Also try to remove the foreign_key field below the Logo data array. That is > not needed and will be added automatically. > > In case this doesn't solve it for you, the only thing I can imagine > clarifying the issue further is a test case. Do you think you can provide > one? You could add it to [2] and base it off one one those already there. > > [1] https://github.com/davidpersson/media/blob/next/docs/RECIPES#L80 > [2] > https://github.com/davidpersson/media/blob/next/tests/cases/models/attachment.test.php > > - David > > -- > Our newest site for the community: CakePHP Video Tutorials > http://tv.cakephp.org > Check out the new CakePHP Questions site http://ask.cakephp.org and help > others with their CakePHP related questions. > > > To unsubscribe from this group, send email to > [email protected] For more options, visit this group at > http://groups.google.com/group/cake-php -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/cake-php
