Need to make sure pieform lib is present in comment build_html()

Bug #1486269 reported by Robert Lyon on 2015-08-18
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
High
Unassigned
15.04
High
Unassigned
15.10
Undecided
Unassigned

Bug Description

Otherwise you can end up with:

PHP Fatal error: Call to undefined function pieform()

Mahara Bot (dev-mahara) wrote :

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

Aaron Wells (u-aaronw) wrote :

To replicate:

0. Clean install of Mahara with two users, User 1 & User 2
1. User1 creates a journal, "Blog B"
2. Put two journal entries in Blog B
3. Create a page, "Page P"
4. Put a "Journal" block on Page P. Select Blog B for the block. Set "number of journal entries per page" to "1".
5. Share Page P with User 2.
6. Log in as User 2
7. Navigate to Page P.
8. You'll see the journal block for Blog B, with a paginator at the bottom. Click the "Next ->" link in the paginator.

Expected result: You should see the second page of blog entries
Actual result: Nothing happens. The error logs show this error stack:

Fatal error: Call to undefined function pieform() in /var/www/mahara/htdocs/artefact/comment/lib.php on line 614
Stack trace:
  1. {main}() /var/www/mahara/htdocs/artefact/blog/posts.json.php:0
  2. ArtefactTypeBlogPost::get_posts() /var/www/mahara/htdocs/artefact/blog/posts.json.php:32
  3. ArtefactTypeComment::get_artefact_comments_for_view() /var/www/mahara/htdocs/artefact/blog/lib.php:840
  4. ArtefactTypeComment::get_comments() /var/www/mahara/htdocs/artefact/comment/lib.php:537
  5. ArtefactTypeComment::build_html() /var/www/mahara/htdocs/artefact/comment/lib.php:470

Aaron Wells (u-aaronw) wrote :

Oh, I left out a step in the above test procedure. You need to comment on the second journal entry. So it should look like this:

1. Clean install of Mahara with two users, User 1 & User 2
2. User1 creates a journal, "Blog B"
3. Put two journal entries in Blog B
4. Create a page, "Page P"
5. Put a "Journal" block on Page P. Select Blog B for the block. Set "number of journal entries per page" to "1".
6. Share Page P with User 2.
7. Log in as User 2
8. Navigate to Page P.
9. Go to the second entry in Blog B and post a comment on it.
10. Go back to page P. Click the "Next ->" link in the paginator for the Blog B journal block

Expected result: You should see the second page of blog entries (containing the entry you commented on)
Actual result: Nothing happens. The error logs show an error stack with "call to undefined function pieform()"

Reviewed: https://reviews.mahara.org/5149
Committed: https://git.nzoss.org.nz/mahara/mahara/commit/42c9153794ea3356a6ba15ce77af2359b56f1533
Submitter: Robert Lyon (<email address hidden>)
Branch: 15.04_STABLE

commit 42c9153794ea3356a6ba15ce77af2359b56f1533
Author: Robert Lyon <email address hidden>
Date: Wed Aug 19 10:09:07 2015 +1200

Bug 1486269: making sure pieform lib is loaded

As there are a few possible pieform forms that could be returned

behatnotneeded

Change-Id: If821842c578116b36a3d1f0560ea15e8b2177a7b
Signed-off-by: Robert Lyon <email address hidden>

Mahara Bot (dev-mahara) wrote :

Reviewed: https://reviews.mahara.org/5150
Committed: https://git.nzoss.org.nz/mahara/mahara/commit/a9de3acd08f373948b29b45fc066c527acb6ebd0
Submitter: Robert Lyon (<email address hidden>)
Branch: master

commit a9de3acd08f373948b29b45fc066c527acb6ebd0
Author: Robert Lyon <email address hidden>
Date: Wed Aug 19 10:09:07 2015 +1200

Bug 1486269: making sure pieform lib is loaded

As there are a few possible pieform forms that could be returned

behatnotneeded

Change-Id: If821842c578116b36a3d1f0560ea15e8b2177a7b
Signed-off-by: Robert Lyon <email address hidden>

Aaron Wells (u-aaronw) on 2015-10-11
Changed in mahara:
status: In Progress → Fix Committed
Robert Lyon (robertl-9) on 2016-11-06
Changed in mahara:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers