cphalcon icon indicating copy to clipboard operation
cphalcon copied to clipboard

[2.0.6] Bug: can't save hasMany relation with lowercase alias

Open galki opened this issue 11 years ago • 4 comments

// this doesn't save (documentation teaches this way)
$album->songs = $songs;
$album->save();

// this does save
$album->Songs = $songs;
$album->save();

// this does save if the relation is hasOne
$album->songs = $song;
$album->save();

The strange thing is I COULD save with lowercase aliases up to and including this version, but not this particular time. No errors were returned and debugging came up with nothing, but Nate's comment suggested capitalizing the alias names and it worked.

galki avatar Aug 11 '15 04:08 galki

@galki I confirmed this bug. Using capitalizing the alias name make it worked.

It must be a bug in belongsTo function.

@andresgutierrez This bug happens in 2.0.7 branch as well

tobasar avatar Sep 02 '15 04:09 tobasar

fyi: have the same issue in 2.0.10 too ( at least for the belongsto ) and the uppercase worked

malletjo avatar May 01 '16 14:05 malletjo

@tobasar @malletjo @galki Could someone provide script to reproduce?

sergeyklay avatar Sep 03 '16 08:09 sergeyklay

I'm closing this issue due to the lack of any reaction. I'll open it again if the need arises

sergeyklay avatar Oct 16 '16 16:10 sergeyklay