Warnings when adding a site image file into a group view

Bug #1122602 reported by Son Nguyen on 2013-02-12
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Medium
Cecilia Vela Gurovic

Bug Description

Version: master
Platform: all
Browser: FF and Chrome

Steps for issue the warnings

1. Login as a group admin or member
2. Edit a group page
3. Add image bloctype
4. In the configure box, select a site image in Site files tab, Click Save and then Done

The warnings:
[WAR] 9f (artefact/file/lib.php:471) Undefined property: stdClass::$author
Call stack (most recent first):

    log_message("Undefined property: stdClass::$author", 8, true, true, "/home/sonn/code/mahara/htdocs/artefact/file/lib.ph...", 471) at /home/sonn/code/mahara/htdocs/lib/errors.php:446
    error(8, "Undefined property: stdClass::$author", "/home/sonn/code/mahara/htdocs/artefact/file/lib.ph...", 471, array(size 14)) at /home/sonn/code/mahara/htdocs/artefact/file/lib.php:471
    ArtefactTypeFileBase::get_my_files_data(0null, "1", "mahara", array(size 1)) at /home/sonn/code/mahara/htdocs/artefact/file/form/elements/filebrowser.php:142
    pieform_element_filebrowser(object(Pieform), array(size 16)) at /home/sonn/code/mahara/htdocs/lib/pieforms/pieform.php:1378
    Pieform->build_element_html(array(size 16)) at /home/sonn/code/mahara/htdocs/lib/pieforms/pieform.php:659
    Pieform->build() at /home/sonn/code/mahara/htdocs/lib/pieforms/pieform.php:899
    Pieform->json_reply(0array(size 7)) at /home/sonn/code/mahara/htdocs/lib/pieforms/pieform.php:866
    Pieform->reply(0array(size 7)) at /home/sonn/code/mahara/htdocs/blocktype/lib.php:588
    BlockInstance->instance_config_store(object(Pieform), array(size 10)) at Unknown:0
    call_user_func_array(array(size 2), array(size 2)) at /home/sonn/code/mahara/htdocs/lib/pieforms/pieform.php:514
    Pieform->__construct(array(size 15)) at /home/sonn/code/mahara/htdocs/blocktype/lib.php:872
    BlockInstance->build_configure_form() at /home/sonn/code/mahara/htdocs/view/blocks.php:87

...

Melissa Draper (melissa) on 2013-02-12
Changed in mahara:
status: New → Triaged
importance: Undecided → Medium
Son Nguyen (ngson2000) wrote :

I got the error:
"A nonrecoverable error occurred. This probably means that you have encountered a bug in the system."
when adding a site file into "File to download" block

Changed in mahara:
assignee: nobody → Cecilia Vela Gurovic (ceciliavg)
status: Triaged → In Progress
Download full text (10.2 KiB)

* When adding a site image in image block on the group page I get different errors, now:

[WAR] 3e (artefact/file/lib.php:682) Undefined property: stdClass::$can_edit
Call stack (most recent first):

    log_message("Undefined property: stdClass::$can_edit", 8, true, true, "/home/ceciliavg/maharacode/mahara/htdocs/artefact/...", 682) at /home/ceciliavg/maharacode/mahara/htdocs/lib/errors.php:521
    error(8, "Undefined property: stdClass::$can_edit", "/home/ceciliavg/maharacode/mahara/htdocs/artefact/...", 682, array(size 16)) at /home/ceciliavg/maharacode/mahara/htdocs/artefact/file/lib.php:682
    ArtefactTypeFileBase::get_my_files_data(0null, "1", "mahara", array(size 1)) at /home/ceciliavg/maharacode/mahara/htdocs/lib/form/elements/filebrowser.php:159
    pieform_element_filebrowser(object(Pieform), array(size 17)) at /home/ceciliavg/maharacode/mahara/htdocs/lib/pieforms/pieform.php:1503
    Pieform->build_element_html(array(size 17)) at /home/ceciliavg/maharacode/mahara/htdocs/lib/pieforms/pieform.php:721
    Pieform->build() at /home/ceciliavg/maharacode/mahara/htdocs/lib/pieforms/pieform.php:976
    Pieform->json_reply(0array(size 8)) at /home/ceciliavg/maharacode/mahara/htdocs/lib/pieforms/pieform.php:943
    Pieform->reply(0array(size 7)) at /home/ceciliavg/maharacode/mahara/htdocs/blocktype/lib.php:851
    BlockInstance->instance_config_store(object(Pieform), array(size 7)) at /home/ceciliavg/maharacode/mahara/htdocs/lib/pieforms/pieform.php:543
    Pieform->__construct(array(size 15)) at /home/ceciliavg/maharacode/mahara/htdocs/lib/mahara.php:4789
    pieform_instance(array(size 15)) at /home/ceciliavg/maharacode/mahara/htdocs/blocktype/lib.php:1219
    BlockInstance->build_configure_form(true) at /home/ceciliavg/maharacode/mahara/htdocs/view/blocks.php:72

[WAR] 3e (artefact/file/lib.php:683) Undefined property: stdClass::$can_view
Call stack (most recent first):

    log_message("Undefined property: stdClass::$can_view", 8, true, true, "/home/ceciliavg/maharacode/mahara/htdocs/artefact/...", 683) at /home/ceciliavg/maharacode/mahara/htdocs/lib/errors.php:521
    error(8, "Undefined property: stdClass::$can_view", "/home/ceciliavg/maharacode/mahara/htdocs/artefact/...", 683, array(size 16)) at /home/ceciliavg/maharacode/mahara/htdocs/artefact/file/lib.php:683
    ArtefactTypeFileBase::get_my_files_data(0null, "1", "mahara", array(size 1)) at /home/ceciliavg/maharacode/mahara/htdocs/lib/form/elements/filebrowser.php:159
    pieform_element_filebrowser(object(Pieform), array(size 17)) at /home/ceciliavg/maharacode/mahara/htdocs/lib/pieforms/pieform.php:1503
    Pieform->build_element_html(array(size 17)) at /home/ceciliavg/maharacode/mahara/htdocs/lib/pieforms/pieform.php:721
    Pieform->build() at /home/ceciliavg/maharacode/mahara/htdocs/lib/pieforms/pieform.php:976
    Pieform->json_reply(0array(size 8)) at /home/ceciliavg/maharacode/mahara/htdocs/lib/pieforms/pieform.php:943
    Pieform->reply(0array(size 7)) at /home/ceciliavg/maharacode/mahara/htdocs/blocktype/lib.php:851
    BlockInstance->instance_config_store(object(Pieform), array(size 7)) at /home/ceciliavg/maharacode/mahara/htdocs/lib/pieforms/pieform.php:543
    Pieform...

To replicate:

- Login as site admin user
- add an image file to site files, but outside public folder
- go to a group page and edit
- add an image block and choose the image
- Save

you should see the errors

- in same page add a block Media/Files to download
- select same image from Site files
- Save

should see the errors

Changed in mahara:
milestone: none → 17.04.0

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

commit e977a8ac89764c2639c6404bc1798f34849680b9
Author: Cecilia Vela Gurovic <email address hidden>
Date: Wed Dec 7 17:48:29 2016 +1300

Bug 1122602: Error message for site image not public in block

In a group page, a site admin can add an image block
with a site file that is not inside the public folder.
The fix adds this case when checking the permissions
edit, view and republish of the image.

behatnotneeded

Change-Id: I00bcff663b05eb5f47463f11da900901b049a5a5

Robert Lyon (robertl-9) on 2017-01-20
Changed in mahara:
status: In Progress → Fix Committed
Robert Lyon (robertl-9) on 2017-04-27
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