Forum list » Configuration »
Relation-fields: Object reference not set to an instance of an object
Pages:  1
(62 posts)

Relation-fields: Object reference not set to an instance of an object

I have just updated a website to Webnodes version 1455. In edit, I get a "critical warning" when I try to select or create a new node in ALL the relation fields.

"Workflow terminated" - "Object reference not set to an instance of an object".

Any solution?

 

 

(144 posts)

Re:Relation-fields: Object reference not set to an instance of an object

Hi!

I'm not able to reproduce this error generally, so I'll be in touch to look at the site in question. It might be a site specific issue, and not a general Webnodes bug.

(144 posts)

Re:Relation-fields: Object reference not set to an instance of an object

I've looked at the code now, and the places where I was able to recreate the error (In the Kurs (Course) content class), on the Deltakere (Participants) relation, the error was due to a function that is executed in the OnNew method. The method had a line that used WAFContext. WAFContext is dependent on being used in a Web context, but when you click the New button, the node is created in a workflow context. 

The solution is very simple: Use the Session property on the node object, and not any context objects.

 

(62 posts)

Re:Relation-fields: Object reference not set to an instance of an object

Ok thank you! Now I got the chance to clean up some old code not longer in use ;)