learnweb / moodle-mod_collabora

:memo: :globe_with_meridians: An activity for live document editing in Moodle, powered by Collabora Online
GNU General Public License v3.0
8 stars 8 forks source link

mod_collabora: Fix getting groupmode from cm #22

Closed grabs closed 3 years ago

grabs commented 3 years ago

This is a fix mod_collabora

Description

If you have a course set on groupmode = SEPARATEGROUPS and additionally groupmodeforce = yes, then you can not edit new created collabora documents. In mod_collabora\api::parse_fileid() the groupmode is checked only by asking the groupmode property from the cm instance $this->cm->groupmode. So the setting in the course is falsely ignored. The effective groupmode should be ask by using the function groups_get_activity_groupmode().

Test instructions

  1. Prepare the course settings: Group mode: Separate groups and Force group mode: Yes.
  2. Activate the editing mode.
  3. Add a new collabora instance with one of the integrated templates (Spreadsheet, Presentation or Wordprocessor).
  4. Show this new instance.
  5. Without the fix an error occurs and with the fix the document works as expected.
codecov-commenter commented 3 years ago

Codecov Report

Merging #22 into master will decrease coverage by 0.02%. The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff              @@
##             master      #22      +/-   ##
============================================
- Coverage     14.04%   14.02%   -0.03%     
  Complexity      137      137              
============================================
  Files            17       17              
  Lines           698      699       +1     
============================================
  Hits             98       98              
- Misses          600      601       +1     
Impacted Files Coverage Δ Complexity Δ
moodle/mod/collabora/classes/api.php 0.00% <0.00%> (ø) 33.00% <0.00%> (ø%)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 5486343...33ea0fd. Read the comment docs.