I suddenly getting “Uncaught TypeError: Cannot read property ‘x’ of undefined” where x is meta, list, change
and more information is about Entity.hasOne, Observable.triggerEvent, Observable.addEventListener all have something to do with persistence.js do you have any suggestions?

Submitted by Terje Pedersen on 20 May 2011 at 10:32

On 20 May 2011 at 10:52 Terje Pedersen commented:

Strange strange.

I have in short form:

entity Reiseregning {
user : User
}

Commenting the “user : User” line, saving, remove comment, save again and it all works again without the errors described :S :S


On 23 May 2011 at 13:35 Terje Pedersen commented:

The meta error is connected to Entity.hasOne why is this one failing??


On 23 May 2011 at 14:03 Terje Pedersen commented:

persistence.js:957

if (otherEntity.meta.isMixin)


On 23 May 2011 at 15:00 Terje Pedersen commented:

I had to change user : User to userid : String and adding function User() : User { return User.load(this.userid); }

Why?


On 6 June 2011 at 11:14 Terje Pedersen commented:

In 0.4.4 I get this on adding a comment to a collection of comments travel.comments.add(comment)

Uncaught TypeError: Cannot read property ‘list’ of undefined
persistence.defineProp.that._data_objpersistence.js:447
(anonymous function)persistence.js:59
persistence.setpersistence.js:71
PropertyFilter.makeFitpersistence.js:1505
AndFilter.makeFitpersistence.js:1392
QueryCollection.addpersistence.js:1822
lib.unilib.callAzure.result__reise.js:9675
Entity.findBypersistence.js:908
QueryCollection.onepersistence.js:1899
persistence.DbQueryCollection.listpersistence.store.sql.js:701


On 6 June 2011 at 11:17 Terje Pedersen commented:

I also get:

OldValue
Type
_data: Object
available: true
img: “lib/i/uni.png”
name: “Brukerinformasjon”
root: function (event, callback) {
proto: Object
proto: Observable

Which I doesn’t understand, because “Brukerinformasjon” information is an Type which isn’t used where I get this logging.


On 6 June 2011 at 11:26 Zef Hemel commented:

Can you give me the entity definition of the type travel is of?


On 6 June 2011 at 11:56 Terje Pedersen commented:

Reiseregning = Travel

And I have dropped out a lot of functions inside both static and non static.


entity Reiseregning {
aid : Num (searchable)
userid : String
beskrivelse : String (searchable)
statusverdi : String (searchable)
status : Num
fradato : DateTime
tildato : DateTime
kommentarer : Collection (inverse: reiseregning)
approval : Num
approvalmelding : String
transportlinjer : Collection (inverse: reisetransport)
overnattinglinjer : Collection (inverse: reiseovernatting)
kostlinjer : Collection (inverse: reisekost)
diverselinjer : Collection (inverse: reisediverse)
typer : Collection (inverse: reiseregning)
inprogress : Bool // forhindre at den samme blir synkronisert av flere tråder
synchronize : Bool // synkronisering av reiseregning
syncapprove : Bool // sync
syncdelete : Bool // sync sletting fra Azure
synctime : DateTime

dim1 : Num
dim2 : Num
dim3 : Num
dim4 : Num
dim5 : Num
dim6 : Num
dim7 : Num
dim8 : Num
dim9 : Num
dim10: Num

linjerhash : String
sum : Num
transportsum : Num			
diversesum : Num
overnattingsum : Num
kostsum : Num

transportantall : Num
diverseantall : Num
overnattingantall : Num
kostantall : Num

}


On 6 June 2011 at 13:35 Zef Hemel commented:

Ok and Kommentar is an entity is as well and has an inverse relationship? Can you show me the property definition of the inverse property?


On 6 June 2011 at 14:02 Terje Pedersen commented:

Yes.

reiseregning : Reiseregning (inverse: kommentarer)


On 8 June 2011 at 16:41 Terje Pedersen commented:

I tried using:

k.reiseregning = this;
// instead of
this.kommentarer.add(k);

But it gave the same error.


On 8 June 2011 at 16:56 Terje Pedersen commented:

I think I have found the lines causing it. I need to check it further tomorrow. Its something about a custom Type :S

Log in to post comments