Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Table of contents #60

Open
wants to merge 33 commits into
base: master
Choose a base branch
from
Open

Conversation

spegenau
Copy link

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