I see the Enrollments tab has changed a little. I like the idea of more edit/manage features there, so the development is very promising.

Perhaps this issue is because the completed courses currently in the list are from before the most recent update of the course module. However, got this error on selecting a row and clicking the Edit enrollment button:
Fatal error: Call to a member function getObjects() on a non-object in /path/to/drupal/modules/course/course.module on line 1831

Thanks for the help.

Comments

djdevin’s picture

I was not able to reproduce this, could you make sure you are using Views 3?

djdevin’s picture

Status: Active » Postponed (maintainer needs more info)
djdevin’s picture

Status: Postponed (maintainer needs more info) » Closed (won't fix)
BasH’s picture

Status: Closed (won't fix) » Needs review

Re-opened this issue because I have a (perhaps) related problem, with a slightly different error. So maybe it is something else but this issue wasn't solved. I have version 6.x-1.0-rc6 (2012-08-07 with a few patches) installed on my production server and 6.x-1.0 (2012-10-08, latest version) on my testserver. On both servers checking an enrollment an clicking "Edit enrollment" results in a fatal error(only a different line):
PHP Fatal error: Call to a member function isComplete() on a non-object in C:\\..\\htdocs\\sites\\all\\modules\\course\\course.module on line 2039, referer: https://my.testsite.nl/node/10143/course-enrollments

PHP Fatal error: Call to a member function isComplete() on a non-object in C:\\..\\htdocs\\sites\\all\\modules\\course\\course.module on line 1961, referer: https://my.site.nl/node/10143/course-enrollments

Maybe you have an idea?

- By the way: on my testserver I can see some course-module parts (credit, requirements, restrict credit) that still have the rc-6 label. Do I first have to uninstall course before upgrading?

djdevin’s picture

Title: Enrollments / Edit enrollments » Fatal error on "Edit enrollments"
Status: Needs review » Active

This may be somewhat related to the original issue so we can discuss it here.

For some reason $courseObject->getFulfillment(); is returning NULL when it should be an object of type CourseObjectFulfillment.

So '#default_value' => $fulfillments[$courseObject->getId()]->isComplete() produces fatal errors.

Which is strange, because $fulfillments is filled from the result of $course->getObjects();

I was unable to reproduce on my clean D6/Course 6.x-1.x

You do not have to uninstall Course to upgrade, but make sure that you completely replace the "course" folder with the new one and run update.php.

Can you provide me with some more information?
1) Version of Views module
2) PHP version (5.2, 5.3)?
3) Types of course objects in the course (also is it happening on all courses?)
4) Version of Autoload module

Thanks,
Devin

BasH’s picture

Thanks again for the fast reply!
Info 1-4
test: Drupal 6.27, Autoload 6.x-2.1 (2011-04-22), Views 3.0, php 5.3.11, mysql client 5.0.8-dev - 20102224
prod: Drupal 6.22, Autoload 6.x-2.1 (2011-04-22), Views 3.0, php 5.2.10, mysql client 5.0.51a

So I am in the process of upgrading...but the error is the same.., maybe a difference still in v1.0 that I am using and v1.x that you tested with?

Objects are quizes and questions, and I think it happens everywhere (but not much material).

Update course info:
Removed the Course directories and did un update after placing the new directories, this only resulted in:
The following queries were executed
course module
Update #6136
ALTER TABLE {course_outline} DROP config

Maybe also some table(s) should be/have to be removed??

djdevin’s picture

There isn't a lot of core change between 1.x and 1.0 so I'd stick with 1.0.

I will play around with some objects and see if I can reproduce. As always try clearing your site cache to make sure Autoload preloads all the classes properly. Your update looked fine.

I see that production is PHP 5.2 which is end of life and no longer supported. Course only supports PHP 5.3, but since this error also appears on your 5.3 development server it looks like that isn't the reason.

If you wouldn't mind getting me a database dump I would be happy to do further investigation and it would really help me.

Thanks,
Devin

BasH’s picture

Clearing the cache changed it a little bit, I think. The first time I visited the enrollment page I noticed that all enrollments were checked. At the moment that is the only moment I get the fatal error. So by checking an individual course I don't have the problem anymore, but when I check all courses I get a fatal error, sounds better to me allready (-:.

(Remark: When I click on the "Next" button, after choosing the "Edit enrollment" of the first course, I get a page with: You selected the following item. The only thing shown there is the number "1" (same for the second course, shows 2), maybe to be replaced by the name?)

My label-rc6 problem is also solved. There appeared to be an old renamed directory in my sites/all/modules. When I removed it and updated my status the rc6-lables were gone.

djdevin’s picture

So by checking an individual course I don't have the problem anymore, but when I check all courses I get a fatal error, sounds better to me allready

Did you mean check an individual user (enrollment)?

So my guess is that there's an enrollment that isn't valid or some error with the bulk operations support in Course. Let me look into this.

BasH’s picture

That's right, I wrote "individual course", but I meant selecting an individual user. When I select "Edit enrollment", I go to a page with the text "Use this form to edit course enrollment and completion data for 1 user". However when I select more then one user I get a fatal error.
I checked my enrollments and they seem to be OK, so indeed the bulk operations support might be the problem .

djdevin’s picture

Status: Active » Closed (fixed)

Thanks, this has been fixed!

I reproduced and it was an error when editing multiple enrollments.

Committed to 6.x and 7.x

  • Commit acffc03 on 7.x-1.x, 7.x-1.x-fieldable-entities, course-object-entity-view by djdevin:
    Issue #1704392: fixed fatal error when editing multiple enrollments
    
  • Commit 509c980 on 7.x-1.x, 7.x-1.x-fieldable-entities, course-object-entity-view by djdevin:
    Issue #1704392: oops use $account