Uncaught TypeError
I suddenly getting “Uncaught TypeError: Cannot read property ‘x’ of undefined” where x is meta, list, change
Submitted by Terje Pedersen on 20 May 2011 at 10:32
and more information is about Entity.hasOne, Observable.triggerEvent, Observable.addEventListener all have something to do with persistence.js do you have any suggestions?
Issue Log
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
The meta error is connected to Entity.hasOne why is this one failing??
persistence.js:957
if (otherEntity.meta.isMixin)
I had to change user : User to userid : String and adding function User() : User { return User.load(this.userid); }
Why?
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
I also get:
OldValue
Type
_data: Object
available: true
img: “lib/i/uni.png”
name: “Brukerinformasjon”
root: function (event, callback) {
proto: Object
proto: ObservableWhich I doesn’t understand, because “Brukerinformasjon” information is an Type which isn’t used where I get this logging.
Can you give me the entity definition of the type
travel
is of?
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 : DateTimedim1 : 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
}
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?
Yes.
reiseregning : Reiseregning (inverse: kommentarer)
I tried using:
k.reiseregning = this;
// instead of
this.kommentarer.add(k);But it gave the same error.
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