Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-33491

Wiki module does not work if you activate the force format option

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: 2.2.3, 2.3
    • Fix Version/s: None
    • Component/s: Wiki (2.x)
    • Labels:
      None
    • Affected Branches:
      MOODLE_22_STABLE, MOODLE_23_STABLE

      Description

      Wiki module does not work if you activate the force format option. If you activate the setting and you can't create a new page from [[new page]] link.

      Error writing to database

      Debug info: Duplicate entry '1-0-0' for key 'mdl_wikisubw_wikgrouse_uix'
      INSERT INTO mdl_wiki_subwikis (wikiid,groupid,userid) VALUES(?,?,?)
      [array (
      0 => '1',
      1 => '0',
      2 => '0',
      )]
      Error code: dmlwriteexception
      Stack trace:
      line 416 of /lib/dml/moodle_database.php: dml_write_exception thrown
      line 952 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
      line 994 of /lib/dml/mysqli_native_moodle_database.php: call to mysqli_native_moodle_database->insert_record_raw()
      line 104 of /mod/wiki/locallib.php: call to mysqli_native_moodle_database->insert_record()
      line 950 of /mod/wiki/pagelib.php: call to wiki_add_subwiki()
      line 115 of /mod/wiki/create.php: call to page_wiki_create->create_page()

        Gliffy Diagrams

          Issue Links

            Activity

            Hide
            thoschi Thomas Schröder added a comment - - edited

            Same here - after unchecking "default format" it is possible to use the wiki, but with the option enabled, it states "Fehler beim Schreiben der Datenbank" (Error writing to database) when opening a new page.

            Moodle 2.2.3+ (Build: 20120615) (Git)

            Show
            thoschi Thomas Schröder added a comment - - edited Same here - after unchecking "default format" it is possible to use the wiki, but with the option enabled, it states "Fehler beim Schreiben der Datenbank" (Error writing to database) when opening a new page. Moodle 2.2.3+ (Build: 20120615) (Git)
            Hide
            monidu Nicolas Dunand added a comment - - edited

            Same problem here. Looks like the code checks for an existing subwiki, and then adds a subwiki if the above test fails, but with different parameters.

            All seems fine if we change this according to my attached patch.

            Show
            monidu Nicolas Dunand added a comment - - edited Same problem here. Looks like the code checks for an existing subwiki, and then adds a subwiki if the above test fails, but with different parameters. All seems fine if we change this according to my attached patch.
            Hide
            thoschi Thomas Schröder added a comment -

            New GIT Version works fine again.
            Great work - thanks!

            Show
            thoschi Thomas Schröder added a comment - New GIT Version works fine again. Great work - thanks!
            Hide
            mitjap Mitja Podreka added a comment -

            Same problem exists also in Moodle 2.1.6 (Build: 20120514)

            Show
            mitjap Mitja Podreka added a comment - Same problem exists also in Moodle 2.1.6 (Build: 20120514)
            Hide
            paaskynen Paul Nijbakker added a comment -

            We run Moodle 2.3.1 and the Force format setting works fine in wikis that have as group mode "No groups". However, in any wiki where the group mode is visible or separate groups, selecting Force format in the settings makes the wiki non-editable for students.

            Show
            paaskynen Paul Nijbakker added a comment - We run Moodle 2.3.1 and the Force format setting works fine in wikis that have as group mode "No groups". However, in any wiki where the group mode is visible or separate groups, selecting Force format in the settings makes the wiki non-editable for students.
            Hide
            paaskynen Paul Nijbakker added a comment -

            Sorry, I should have been clearer that this concerns collaborative wikis with groups.

            Show
            paaskynen Paul Nijbakker added a comment - Sorry, I should have been clearer that this concerns collaborative wikis with groups.
            Hide
            salvetore Michael de Raadt added a comment -

            This is a duplicate issue. The problem has been resolved.

            Show
            salvetore Michael de Raadt added a comment - This is a duplicate issue. The problem has been resolved.
            Hide
            t6nis20 Tõnis Tartes added a comment -

            Well.. for me it seems it still doesnt work, when having collaborative wikis with forced format..

            Steps to reproduce:
            1.Make sure, you have different groups on course with couple of student in it.
            2.Create a wiki (collaborative, with forceformat option, groups option:separate)
            3.As teacher add some content to - All participants
            4.(first bug as teacher) - try to change group, it redirects you back to All participants edit view
            5.(second bug as student) - log in as some student from a group, try to view/edit the wiki(you'll get: You can not edit this page)

            I tried it in - http://qa.moodle.net

            Only if you untick the force format option, it gives teacher/students the option to create pages for groups.

            Correct me if im wrong, maybe i missed something in the wiki's logic?

            Show
            t6nis20 Tõnis Tartes added a comment - Well.. for me it seems it still doesnt work, when having collaborative wikis with forced format.. Steps to reproduce: 1.Make sure, you have different groups on course with couple of student in it. 2.Create a wiki (collaborative, with forceformat option, groups option:separate) 3.As teacher add some content to - All participants 4.(first bug as teacher) - try to change group, it redirects you back to All participants edit view 5.(second bug as student) - log in as some student from a group, try to view/edit the wiki(you'll get: You can not edit this page) I tried it in - http://qa.moodle.net Only if you untick the force format option, it gives teacher/students the option to create pages for groups. Correct me if im wrong, maybe i missed something in the wiki's logic?
            Hide
            t6nis20 Tõnis Tartes added a comment -

            i looked into the code and this seemed to resolve my issue with forcedformat
            https://github.com/t6nis/moodle/commit/11c35e5ef6c27c40f8377a111b5338f4d22dc879

            Could someone review this?

            Show
            t6nis20 Tõnis Tartes added a comment - i looked into the code and this seemed to resolve my issue with forcedformat https://github.com/t6nis/moodle/commit/11c35e5ef6c27c40f8377a111b5338f4d22dc879 Could someone review this?
            Hide
            kkrueger Katja Krüger added a comment -

            Yes I think too you have to reopen this issue. I upgraded to Version Moodle 2.3.2+ (Build: 20120920)but this force format option problem was not solved. I tried out the code Tönis provided and that really solved the problem.
            Thanks Tönis

            Show
            kkrueger Katja Krüger added a comment - Yes I think too you have to reopen this issue. I upgraded to Version Moodle 2.3.2+ (Build: 20120920)but this force format option problem was not solved. I tried out the code Tönis provided and that really solved the problem. Thanks Tönis
            Hide
            tsala Helen Foster added a comment -

            Tõnis, thanks for your patch and thanks to both you and Katja for testing the issue.

            Rather than reopening it, please could one of you create a new issue for the problem reoccurring in 2.3.2. Please link this issue to the new issue.

            Show
            tsala Helen Foster added a comment - Tõnis, thanks for your patch and thanks to both you and Katja for testing the issue. Rather than reopening it, please could one of you create a new issue for the problem reoccurring in 2.3.2. Please link this issue to the new issue.
            Hide
            t6nis20 Tõnis Tartes added a comment -
            Show
            t6nis20 Tõnis Tartes added a comment - Made a new issue - http://tracker.moodle.org/browse/MDL-35653

              People

              • Votes:
                11 Vote for this issue
                Watchers:
                11 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: