Bugs after updating Mahara
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Mahara |
Invalid
|
Undecided
|
Unassigned |
Bug Description
Hello,
After the update to the latest version of Mahara (16.04) I have problems with the display pages of the groups.
Here is an example :
[WAR] 1b (lib/group.
Call stack (most recent first):
log_
error(integer, string(size 36), string(size 53), integer, array(size 2)) at /mypath/
group_
View-
[WAR] 1b (lib/errors.
Command was: INSERT INTO "view" ("ctime", "mtime", "atime", "copynewuser", "anonymise") VALUES (?, ?, ?, ?, ?) and values was (ctime:
Call stack (most recent first):
log_
log_
SQLExceptio
insert_
View->commit() at /mypath/
View-
View-
[WAR] 1b (lib/dml.php:1088) Failed to get a recordset: mysqli error: [1452: Cannot add or update a child row: a foreign key constraint fails ("mybdd"."view", CONSTRAINT "view_ibfk_7" FOREIGN KEY ("type") REFERENCES "view_type" ("type"))] in EXECUTE("INSERT INTO "view" ("ctime", "mtime", "atime", "copynewuser", "anonymise") VALUES ('2016-10-12 15:32:22', '2016-10-12 15:32:22', '2016-10-12 15:32:22', 0, 0)")
Command was: INSERT INTO "view" ("ctime", "mtime", "atime", "copynewuser", "anonymise") VALUES (?, ?, ?, ?, ?) and values was (ctime:
Call stack (most recent first):
insert_
View->commit() at /mypath/
View-
View-
Untitled
Mywebsite Mahara : Site unavailable
A nonrecoverable error occurred. This probably means you have encountered a bug in the system
Thank you for your help.
Hi Antonella,
The errors you are seeing comes from this scenario:
You visit a group owned page and that page tries to fetch the name of the group it belongs to so it can display that name as page's author by fetching the info from the group's homepage.
But for some reason in this instance the group's homepage can't be found, which is very strange as one shouldn't be able to delete the group's homepage via Mahara itself.
I could replicate getting the same errors when I changed one of my groups homepage view (via db) from type = 'grouphomepage' to type = 'portfolio'.
Can I get you to find the page you are trying to view in the database and therefore find out it's group id number.
SELECT title,`group` FROM view WHERE id = [ID];
where you replace the [ID] with the view id of the page.
Once you find the group id then do a query like:
SELECT id,title,type FROM view where `group` = [ID];
where you replace the [ID] with the group id number you found.
Normally it should show something similar to:
id | title | type ------- ------- +------ ------- ---
----+--
62 | Group page 1 | portfolio
53 | Group page 2 | portfolio
51 | Group homepage | grouphomepage
where one (and only one) of the group's pages is the type grouphomepage
If there are no pages with type = grouphomepage then can you either set one of the existing pages (via db) for the group to be type = grouphomepage
Or you can go to the group (via browser) and on the Pages tab click 'create page', give it a title and save (no need to edit content yet). Get it's id by looking at the url in browser and then (via db) update that page to be type grouphomepage.
UPDATE view SET type = 'grouphomepage' WHERE id = [ID];
where you replace the [ID] with the page's id number you want to use.
Then reload the page in browser and you should see the title of the page has changed to 'Group homepage' and you will be able to add group homepage blocks to it now.
Add what you need and then click 'Return to group pages'.
So now when you go to view the page that was broken before it should display fine.
If you are able to shed any light into how the grouphomepage got removed that would be very helpful too
Cheers
Robert