If somebody's interested: I found the problem...

My authors_media table didn't have an "id" column! What a silly mistake...

 As already mentioned, the application I'm working on was created by
somebody else, and I'm not into CakePHP very deeply yet and didn't
work with PHP for a few years. So I've just taken over everything, and
didn't dig deep enough into the code etc. because I was frightened
already.
Now, a few weeks later now, I started again debugging it, and found
the problem quite fast.

The warning:

Undefined index:  id [CORE/cake/libs/model/model.php, line
1391]

in __saveMulti() says exact that the "id" column in the db-table is
missing! But the problem before was that I upgraded CakePHP from 1.2.0
to 1.3 where the word "Media" got a new inflection-rule (singular form
is now still Media, not Medium). So after solving this first problem
(by adding an inflection irregularity) I still thought that something
with the word is not OK, but in fact it was a completely different
problem then, as I see now. But I stuck too deep in these
uncertainties to get it a few weeks ago.

Well, I'm happy and sort of proud that I figured this out now. I
definitely paid my apprentice's due for that... :-)

Thanks anyway for your help, guys!

On Mon, Sep 27, 2010 at 7:21 PM, cricket <zijn.digi...@gmail.com> wrote:
> On Mon, Sep 27, 2010 at 3:16 AM, Joshua Muheim <psybea...@gmail.com> wrote:
>> I didn't change anything in the source, and it worked under v1.2.0.x,
>> and now it doesn't anymore. So I presume it's because of the upgrade
>> to v1.3.4, and I also found this:
>>
>> "Adding media as an uninflected word" on 
>> https://trac.cakephp.org/changeset/5104
>>
>> Anyone could try to bake a small application with a Medium/Media model
>> that has a HABTM relationship to an Author/Authors model? As far as I
>> can see this is NOT possible for some reason... And don't forget to
>> add the inflection rule:
>>
>> Inflector::rules('plural', array('rules' => array(), 'irregular' =>
>> array('medium' => 'media'), 'uninflected' => array()));
>
> I'm not denying there may be a problem. In fact, I'm suggesting that
> there may be two. In your first message you said that you thought the
> issue with Medium had been resolved. I'm suggesting that the error msg
> about a missing id may have nothing whatsoever to do with the "Medium"
> issue. Have you investigated any further? What's happening at line
> 1391? Are you trying to create, or modify, in this instance? If the
> latter, does your form actually include an id in a hidden element?
> etc. etc.
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others 
> with their CakePHP related questions.
>
> You received this message because you are subscribed to the Google Groups 
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/cake-php?hl=en
>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

Reply via email to