Hello Moodle-Developers,
I am trying to integrate the moodle comment-functionality to an local plugin. I was using the code snippets from the Moodle documentation here: https://docs.moodle.org/dev/Comment_API. It sound so easy, but unfortunately the reality isn't quite so simple as the theory. Also I am a moodle beginner. In my DB there is also an comment table, just like the one in the documentation, but the column order is a bit different.
Here is my Code so far (the red marked lines are my changes):
Without my changes in the Code, the page looks like this in the browser:
When I try to load my page with my red marked changes, I run into some errors:
1. Notice: Undefined variable: context in C:\xampp\htdocs\moodle2_9\local\alv\views\request_view.php on line 54
2. Notice: Undefined variable: record in C:\xampp\htdocs\moodle2_9\local\alv\views\request_view.php on line 55
3. Notice: Trying to get property of non-object in C:\xampp\htdocs\moodle2_9\local\alv\views\request_view.php on line 55
4.
With what do I fill the variables Context & Record? There is nothing explained in the documentation of the comment API. Am I doing something wrong?
I am thankful for any advice!