Moodle

Warning when creating a new feedback

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 1.9.2
  • Fix Version/s: 1.9.1, 1.9.2, 1.9.3
  • Component/s: Feedback
  • Labels:
    None
  • Environment:
    Moodle 1.9, Apache2, Debian4, php5, Mysql5
  • Database:
    MySQL
  • Affected Branches:
    MOODLE_19_STABLE
  • Fixed Branches:
    MOODLE_19_STABLE

Description

When creating a new feedback, a quick warning appears stating access to a non defined class variable id on line 296

here are the involved line (in the file mod/feedback/lib.php)

function feedback_set_events($feedback) {
// adding the feedback to the eventtable (I have seen this at quiz-module)
===> delete_records('event', 'modulename', 'feedback', 'instance', $feedback->id);
...

should be changed in

if (isset($feedback->id)) { delete_records('event', 'modulename', 'feedback', 'instance', $feedback->id); }

  • it is reported in moodle core allthough the module is in the contributed area for the Moodle version I am using (1.9.2)

Activity

Hide
Andreas Grabs added a comment -

Hi Christian,

I can not see the problem. Whenever I call the function feedback_set_events($feedback) the variable $feedback is set and within the member $id.
Did you try the latest version for moodle 1.9.x?

Andreas

Show
Andreas Grabs added a comment - Hi Christian, I can not see the problem. Whenever I call the function feedback_set_events($feedback) the variable $feedback is set and within the member $id. Did you try the latest version for moodle 1.9.x? Andreas
Hide
Christian Deligant added a comment -

Yes the feedback object is set, but when creating a new feedback the id of the feedback object is not.

It is the release for moodle 1.9.x, module version 2008050111

Thank you

Show
Christian Deligant added a comment - Yes the feedback object is set, but when creating a new feedback the id of the feedback object is not. It is the release for moodle 1.9.x, module version 2008050111 Thank you
Hide
Andreas Grabs added a comment -

sorry, there was a typo. I modified the function feedback_add_instance. Now the $id is set.
Thank you very much!
Andreas

Show
Andreas Grabs added a comment - sorry, there was a typo. I modified the function feedback_add_instance. Now the $id is set. Thank you very much! Andreas
Hide
Tim Hunt added a comment -

Just to not that it looks like this was already fixed in the version added to Moodle 2.0 dev.

Show
Tim Hunt added a comment - Just to not that it looks like this was already fixed in the version added to Moodle 2.0 dev.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: