Skip to content

Table of contents#60

Open
spegenau wants to merge 34 commits intomoodleou:masterfrom
eLearning-TUDarmstadt:master
Open

Table of contents#60
spegenau wants to merge 34 commits intomoodleou:masterfrom
eLearning-TUDarmstadt:master

Conversation

@spegenau
Copy link
Copy Markdown

These changes add a numbered table of contents to every wiki page

Steffen Pegenau and others added 28 commits April 5, 2016 11:55
Create a wiki with the settings 'seperate groups' and 'seperate wiki for
each group'.
Open the wiki, you will get the message that the page has not been created
yet.
Reload the page and you will receive a db write error.

table: ouwikis_subwikis
I think the problem is related to two uniqueness restrictions:
1. There must be only one entry for a group and wiki
2. There must be only one entry for a wiki and user (a seperate wiki for
every user)

In case of group wikis the user field is NULL. When opening the wiki
first, an table entry is generated. When opening it the second time,
Moodle tries to generate a second entry. But there already is the same
combination of wiki and user (NULL)

- The user-id is written to every entry in the mentioned table to avoid
  collisions of wikiid<->NULL
- When getting the subwiki, moodle shall not look for user=NULL

This may lead to problems in case of seperate wikis for every user
There are two constraints on the table ouwiki_subwikis
1. combination of wikiid and groupid must be unique
2. combination of wikiid and userid must be unique

Example:
Two subwikis for different groups resulted in
wikiid: 1 groupid: 1 userid: NULL
wikiid: 1 groupid: 2 userid: NULL

On MSSQL this is prohibited by constraint 2 and
the creation of the second subwiki resulted in
an exception.

To fix this the magic number is used as userid or groupid in case
they are NULL.
# Conflicts:
#	entirewiki.php
#	lang/en/ouwiki.php
#	locallib.php
#	styles.css
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants