I receive these messages for each course node content since a install the latest dev version.

Notice : Trying to get property of non-object in CourseObjectNode->optionsForm() (ligne 1176 in course_object.core.inc).
Notice : Trying to get property of non-object dans CourseObjectNode->getEditUrl() (ligne 1087 in course_object.core.inc).

Thanks for your help!

Simon

Comments

SimonMartineau’s picture

I understand why I received these messages: I deleted the object reffered by the outline so course can't get information about them. I think something have to be done to manage this kind of situation (deleted indication in the content line in the outline?).

Thanks.

djdevin’s picture

Thanks, yes it is trying to create a link to the node.

SimonMartineau’s picture

Status: Active » Closed (fixed)
djdevin’s picture

Assigned: Unassigned » djdevin
Status: Closed (fixed) » Active

Leaving this open - it's a bug so it should be fixed :)

djdevin’s picture

We need to think about this one.

When a node is deleted that is part of a course, what should happen?

1) Block the deletion
2) Delete the course object
3) Set the instance to 0 (which would cause a new node to be created on course save)
4) Find some other way to have a "broken" course node object

djdevin’s picture

Assigned: djdevin » Unassigned
Priority: Normal » Major
djdevin’s picture

Title: I received theses notices when I show a course node » Errors when a node is deleted, leaving an orphaned course object
joshmmo’s picture

I would hesitate to just delete the course object because a user might accidentally delete a page which is linked and then wonder why the object is not working (if they have a large amount of content). I would display a message on the object list saying it was deleted and ask if the user wants to delete the object.

But I yet have been able to find a delete object button anywhere.... =(

djdevin’s picture

The way you delete an object is to go into its settings, then check 'Delete' and save the object. Then when you save the course it is deleted.

joshmmo’s picture

Thanks,

Such an odd way to delete something.

djdevin’s picture

Haha, I know.

The reasoning behind it is that you can't immediately delete a course object (the course outline is stored temporarily, similar to the ways Views displays and other Drupal modules behave) so you have to mark it as deleted first.

Ideally there would be a delete button on the course outline that would do the same thing.

djdevin’s picture

Oh, the other reason why is because if you delete a course object you are presented with another option to delete the linked content.

djdevin’s picture

Issue summary: View changes
Priority: Major » Normal
Status: Active » Needs work