EmbeddedImage::prepare_embedded_images() - Undefined variable: form

Bug #1427027 reported by Ghada El-Zoghbi on 2015-03-02
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
High
Son Nguyen

Bug Description

Mahara: 15.04dev
OS: Linux
DB: postgres, mysql
browser: any

The function EmbeddedImage::prepare_embedded_images() in htdocs/lib/embeddedimage.php has 2 undefined variables:

$form and $element

on line 61.

[WAR] 62 (lib/embeddedimage.php:61) Undefined variable: form
Call stack (most recent first):

    log_message("Undefined variable: form", 8, true, true, "/var/www/maharacode/mahara/htdocs/lib/embeddedimag...", 61) at /var/www/maharacode/mahara/htdocs/lib/errors.php:441
    error(8, "Undefined variable: form", "/var/www/maharacode/mahara/htdocs/lib/embeddedimag...", 61, array(size 20)) at /var/www/maharacode/mahara/htdocs/lib/embeddedimage.php:61
    EmbeddedImage::prepare_embedded_images("<p>aaaa&nbsp;<img src="http://d.general.mahara/art...", "post", 2, "1") at /var/www/maharacode/mahara/htdocs/interaction/forum/editpost.php:198
    editpost_submit(object(Pieform), array(size 7)) at Unknown:0
    call_user_func_array("editpost_submit", array(size 2)) at /var/www/maharacode/mahara/htdocs/lib/pieforms/pieform.php:532
    Pieform->__construct(array(size 4)) at /var/www/maharacode/mahara/htdocs/lib/pieforms/pieform.php:162
    Pieform::process(array(size 4)) at /var/www/maharacode/mahara/htdocs/lib/pieforms/pieform.php:71
    pieform(array(size 4)) at /var/www/maharacode/mahara/htdocs/interaction/forum/editpost.php:173

It can be reproduced by:

- Create a group and enter a new topic in the forum.
- As a regular user - not the owner of the group - create a reply (with an image) to the topic
- As the owner of the group, edit the reply.
- above error will be generated.

Changed in mahara:
importance: Undecided → Low
status: New → Confirmed
Son Nguyen (ngson2000) wrote :

I marked it high as it is related to the patch https://reviews.mahara.org/#/c/4124

Changed in mahara:
assignee: nobody → Son Nguyen (ngson2000)
status: Confirmed → In Progress
importance: Low → High
Son Nguyen (ngson2000) on 2015-03-12
Changed in mahara:
milestone: none → 15.04.0

Reviewed: https://reviews.mahara.org/4382
Committed: http://gitorious.org/mahara/mahara/commit/5c68436247b8fedd51725468fbb5dbfe00e55725
Submitter: Robert Lyon (<email address hidden>)
Branch: master

commit 5c68436247b8fedd51725468fbb5dbfe00e55725
Author: Son Nguyen <email address hidden>
Date: Fri Mar 13 09:22:07 2015 +1300

Strip out unnecessary $form and $element. Bug 1427027

Change-Id: I07615cbbee5914b2affb5b26edc69d64539f6a2c

Robert Lyon (robertl-9) on 2015-03-16
Changed in mahara:
status: In Progress → Fix Committed
Robert Lyon (robertl-9) on 2015-04-17
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