Textbox blocktype raising error when configdata['artefactids'] is not set

Bug #1514661 reported by Ghada El-Zoghbi
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Fix Released
Low
Unassigned
15.10
Fix Released
Low
Unassigned

Bug Description

Mahara 15.10
version = 2015092910
release = 15.10.0

DB: postgresql (but shouldn't matter)

Upgrading from Mahar 1.10 to 15.10, some textboxes give the following error:

[WAR] 3b (artefact/internal/blocktype/textbox/lib.php:313) Undefined index: artefactids
Call stack (most recent first):

    log_message("Undefined index: artefactids", 8, true, true, "/var/www/mahara-site-acttqi-1510/artefact/internal...", 313) at /var/www/mahara-site-acttqi-1510/lib/errors.php:441
    error(8, "Undefined index: artefactids", "/var/www/mahara-site-acttqi-1510/artefact/internal...", 313, array(size 18)) at /var/www/mahara-site-acttqi-1510/artefact/internal/blocktype/textbox/lib.php:313
    PluginBlocktypeTextbox::instance_config_form(object(BlockInstance), "0") at Unknown:0
    call_user_func_array(array(size 2), array(size 2)) at /var/www/mahara-site-acttqi-1510/lib/mahara.php:1693
    call_static_method("PluginBlocktypeTextbox", "instance_config_form", object(BlockInstance), "0") at /var/www/mahara-site-acttqi-1510/blocktype/lib.php:1017
    BlockInstance->build_configure_form(false) at /var/www/mahara-site-acttqi-1510/blocktype/lib.php:817
    BlockInstance->render_editing(true) at /var/www/mahara-site-acttqi-1510/lib/view.php:2445
    View->configureblockinstance(array(size 2)) at /var/www/mahara-site-acttqi-1510/lib/view.php:1849
    View->process_changes() at /var/www/mahara-site-acttqi-1510/view/blocks.json.php:30

The configdata['artefacids'] is not set.

We should check for:

    && isset($configdata['artefactids'])

on line 313 of artefact/internal/blocktype/textbox/lib.php

as we do in other blocktypes.

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/5691

Revision history for this message
Aaron Wells (u-aaronw) wrote :

Hi Ghada,

Thanks for the bug report and the code fix. I've made it into a patch and pushed it into gerrit with you as the author: https://reviews.mahara.org/5691

Do you have any idea how to generate one of the text boxes which will cause this warning message?

Cheers,
Aaron

Revision history for this message
Ghada El-Zoghbi (ghada-z) wrote :

Hi Aaron,

This is an upgrade (1.10 -> 15.10) so I'm not quite sure how the field got into that state.

But, the view was originally copied from an institution view. Then, the institution view was later deleted.

It may have something to with this.

Thanks,
Ghada

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

Reviewed: https://reviews.mahara.org/5691
Committed: https://git.mahara.org/mahara/mahara/commit/1dacaab92e5864196c5e9d8edc4557a45022e26c
Submitter: Aaron Wells (<email address hidden>)
Branch: master

commit 1dacaab92e5864196c5e9d8edc4557a45022e26c
Author: Ghada El-Zoghbi <email address hidden>
Date: Wed Nov 11 15:58:40 2015 +1300

Prevent "Undefined index" warning (Bug 1514661)

behatnotneeded: Requires an upgrade to generate the warning

Change-Id: Ic412e92a7d1ed35765ed41f3ee8772e63f1bb3e5

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

Patch for "15.10_STABLE" branch: https://reviews.mahara.org/5703

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

Reviewed: https://reviews.mahara.org/5703
Committed: https://git.mahara.org/mahara/mahara/commit/3286011f3b4fa1f623940eb0ada817d1e210771a
Submitter: Robert Lyon (<email address hidden>)
Branch: 15.10_STABLE

commit 3286011f3b4fa1f623940eb0ada817d1e210771a
Author: Ghada El-Zoghbi <email address hidden>
Date: Wed Nov 11 15:58:40 2015 +1300

Prevent "Undefined index" warning (Bug 1514661)

behatnotneeded: Requires an upgrade to generate the warning

Change-Id: Ic412e92a7d1ed35765ed41f3ee8772e63f1bb3e5
(cherry picked from commit 1dacaab92e5864196c5e9d8edc4557a45022e26c)

no longer affects: mahara/16.04
Changed in mahara:
status: Fix Committed → Fix Released
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.