New topic in forum: createtopicusers error

Bug #1712681 reported by Cecilia Vela Gurovic
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Fix Released
High
Cecilia Vela Gurovic
17.04
Fix Released
High
Cecilia Vela Gurovic
17.10
Fix Released
High
Cecilia Vela Gurovic

Bug Description

When we have old groups, the Forums may not have the 'createtopicusers' property defined in the config. So the following error happens:

When I want to create a topic in "Open Discussion" (I am a group admin), I get the following warning:

[WAR] bd (interaction/forum/edittopic.php:70) Undefined index: createtopicusers
Call stack (most recent first):

log_message("Undefined index: createtopicusers", 8, true, true, "/var/www/mahara-org-testing-mahara/releases/201708...", 70) at /var/www/mahara-org-testing-mahara/releases/20170816213625/lib/errors.php:521
error(8, "Undefined index: createtopicusers", "/var/www/mahara-org-testing-mahara/releases/201708...", 70, array(size 65)) at /var/www/mahara-org-testing-mahara/releases/20170816213625/interaction/forum/edittopic.php:70

[WAR] bd (interaction/forum/edittopic.php:70) Trying to get property of non-object
Call stack (most recent first):

log_message("Trying to get property of non-object", 8, true, true, "/var/www/mahara-org-testing-mahara/releases/201708...", 70) at /var/www/mahara-org-testing-mahara/releases/20170816213625/lib/errors.php:521
error(8, "Trying to get property of non-object", "/var/www/mahara-org-testing-mahara/releases/201708...", 70, array(size 65)) at /var/www/mahara-org-testing-mahara/releases/20170816213625/interaction/forum/edittopic.php:70

summary: - createtopicusers
+ New topic in forum: createtopicusers error
Revision history for this message
Mahara Bot (dev-mahara) wrote : A patch has been submitted for review

Patch for "master" branch: https://reviews.mahara.org/7943

Revision history for this message
Niranjan (niranjan528) wrote :

Bug description: Creating a new topic in forum is throwing an warning message

Environment to be tested: Master branch
Browser testing: Not applicable

Precondition Note: This is happening for groups on a Mahara site that has been upgraded for several years. So to replicate the issue, the database is manipulated.

Preconditions:

1. The group ‘Group A’ exists and the user ‘admin’ is the group admin in that group.
2. A second user, UserA, is a regular group member in the group.
3. Change the config file to ‘productionmode = false;’

Steps to reproduce:

1. Log in to the database using the following command (assuming Postgres as database):
sudo -u postgres psql 'name of the database'
2. Validate the 'Field name' and 'Forum number' using below query in database.
select * from interaction_forum_instance_config;
3.Delete ‘Forum instance’ from the table using below query in database.
delete from interaction_forum_instance_config where field='createtopicusers' and forum=30;
4. Log in to Mahara as a group admin.
5. Navigate to Main menu > Groups.
6. Select ‘Forums’ tab.
7. Click on ‘General discussion’ forum.
8. Select ‘New topic’ button.
9. Similarly, log in as ‘User A’ and repeat steps 5 to 8.

Expected Result: New topic form should open without any error/warning messages.
Actual Result: New topic form opened without any error/warning message.

Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/7943
Committed: https://git.mahara.org/mahara/mahara/commit/b48e6e627d657ac99c98e297ad067114e52dc9bc
Submitter: Robert Lyon (<email address hidden>)
Branch: master

commit b48e6e627d657ac99c98e297ad067114e52dc9bc
Author: Cecilia Vela Gurovic <email address hidden>
Date: Thu Aug 24 08:55:16 2017 +1200

Bug 1712681: topic in forum 'createtopicusers' check

behatnotneeded

Change-Id: I488cc4cfffdc9c30f67f001c6d7ce72ae71cc20d

Revision history for this message
Mahara Bot (dev-mahara) wrote : A patch has been submitted for review

Patch for "17.04_STABLE" branch: https://reviews.mahara.org/7967

Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/7967
Committed: https://git.mahara.org/mahara/mahara/commit/af4980c530ca4e1242ed25d685edb6b0ff53e142
Submitter: Robert Lyon (<email address hidden>)
Branch: 17.04_STABLE

commit af4980c530ca4e1242ed25d685edb6b0ff53e142
Author: Cecilia Vela Gurovic <email address hidden>
Date: Thu Aug 24 08:55:16 2017 +1200

Bug 1712681: topic in forum 'createtopicusers' check

behatnotneeded

Change-Id: I488cc4cfffdc9c30f67f001c6d7ce72ae71cc20d

said (said2014)
tags: added: software webcam
tags: removed: software webcam
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.