# Journal

Activities ::: mod_journal
Maintained by Cosmin HERMAN, Adrian Sarmas, Ovidiu Morariu, Paul Neag
This module allows a teacher to ask students to reflect on a particular topic. The students can edit and refine their answer over time.
Latest release:
3982 sites
68 fans

This module allows a teacher to ask students to reflect on a particular topic. The students can edit and refine their answer over time.

### Contributors

David Monllaó: Previous maintainer

### Awards

• Wed, Sep 9, 2020, 10:19 PM
Would love to have 3.9 support. Is there a timetable for 3.9?
• Thu, Sep 10, 2020, 1:54 AM
I am interested in seeing this plugin updated to version 3.9 too... if possible...
• Fri, Sep 11, 2020, 5:26 PM
We updated to Moodle 3.9 and added some bugfixes in the lastest version released today.
• Sat, Sep 12, 2020, 3:27 PM
Hello,
First of all thanks to the developer of this module for the great work done!

I would like to report a conflict that exists between this module and the GDPR functionality of moodle. If the GDPR functionality is enabled and a user is deleted (after a user request or manually), then the deletion process crashes and it is never completed. The scheduled tasks logs also fill up with every execution of the user_deletion task, failing to complete the process. I had spotted the bug a few months ago when I noticed that the user anonymization/deletion was not being completed.

What I found was that in the classes/privacy/provider.php file, the first two methods do not specify the return type on the method declaration.
A proposed fix, which works in the versions 3.8 and previously, was to add the return value to these two methods, i.e. get_metadata(collection) and get_contexts_for_userid(userid) as follows:

public static function get_metadata(collection $collection) : collection and public static function get_contexts_for_userid(int$userid) : contextlist

Below I attach the "corrected" code from the provider.php file

/**
*
* @param collection $collection The initialised collection to add items to. * @return collection A listing of user data stored through this system. */ public static function get_metadata(collection$collection) : collection {
$collection->add_database_table( 'journal_entries', [ 'userid' => 'privacy:metadata:journal_entries:userid', 'modified' => 'privacy:metadata:journal_entries:modified', 'text' => 'privacy:metadata:journal_entries:text', 'rating' => 'privacy:metadata:journal_entries:rating', 'entrycomment' => 'privacy:metadata:journal_entries:entrycomment', ], 'privacy:metadata:journal_entries' ); return$collection;
}

/**
* Get the list of contexts that contain user information for the specified user.
*
* @param int $userid The user to search. * @return contextlist$contextlist The contextlist containing the list of contexts used in this plugin.
*/
public static function get_contexts_for_userid(int $userid) : contextlist {$sql = "
SELECT DISTINCT ctx.id
FROM {%s} fc
JOIN {modules} m
ON m.name = :journal
JOIN {course_modules} cm
ON cm.instance = fc.journal
AND cm.module = m.id
JOIN {context} ctx
ON ctx.instanceid = cm.id
AND ctx.contextlevel = :modlevel
WHERE fc.userid = :userid";

$params = ['journal' => 'journal', 'modlevel' => CONTEXT_MODULE, 'userid' =>$userid];
$contextlist = new contextlist();$contextlist->add_from_sql(sprintf($sql, 'journal_entries'),$params);
return $contextlist; } • Sat, Sep 12, 2020, 4:14 PM Hello again, For the 2020091100 version, please update the version.php file with the new version, because it has the old version and does not trigger the moodle database upgrade.$plugin->version = 2020091100;

Thank you!
• Thu, Sep 17, 2020, 2:52 AM
Hi there, I have this problem that Filippos Kolovos says... is the fix that he said correct?
• Thu, Sep 17, 2020, 3:12 AM
It doesn't seem that the update to 2.1.0 is working. When I try to do the update I get the message saying "[Warning] Target location already exists and will be removed". I have removed the folder as well as uninstalling and reinstalling the updated version. The message keeps showing up. Any suggestions?
• Wed, Sep 23, 2020, 1:59 PM
Hi. Can I also please add a request to have the version.php file updated in the latest plugin release as it still has the previous version number and won't trigger the upgrade DB process.
The code on github is correct and works fine as an alternate.
• Thu, Sep 24, 2020, 8:04 PM
Hi all
I don't think it is just wrong version.php, its missing some fixes, (for example https://github.com/elearningsoftware/moodle-mod_journal/pull/48 is missing). The latest build contains the previous one.
Github version is working fine.
• Fri, Sep 25, 2020, 4:34 AM
ew version 2020091100 contains error in version.php? (brings update process in a loop)

this is wrong distribution, with loop:

$plugin->component = 'mod_journal';$plugin->version = 2020091100;
$plugin->requires = 2017111300; /* Moodle 3.4 */$plugin->release = '2.1.0 (Build: 2020091100)';
$plugin->maturity = MATURITY_STABLE;$plugin->cron = 60;

this is from git and works, no loop:

$plugin->component = 'mod_journal';$plugin->version = 2020020700;
$plugin->requires = 2013111800; /* Moodle 2.6 */$plugin->release = '2.0.0 (Build: 2019061600)';
$plugin->maturity = MATURITY_STABLE;$plugin->cron = 60;
• Fri, Sep 25, 2020, 4:36 AM
new version 2020091100 contains error in version.php? (brings update process in a loop)

this is in distribution with loop:

$plugin->component = 'mod_journal';$plugin->version = 2020091100;
$plugin->requires = 2017111300; /* Moodle 3.4 */$plugin->release = '2.1.0 (Build: 2020091100)';
$plugin->maturity = MATURITY_STABLE;$plugin->cron = 60;

this is from git and installs ok

$plugin->component = 'mod_journal';$plugin->version = 2020020700;
$plugin->requires = 2013111800; /* Moodle 2.6 */$plugin->release = '2.0.0 (Build: 2019061600)';
$plugin->maturity = MATURITY_STABLE;$plugin->cron = 60;
• Fri, Sep 25, 2020, 5:30 PM