Warning message when deleting a blog

Bug #1489284 reported by Aaron Wells
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Fix Released
High
Son Nguyen
15.04
Fix Released
High
Robert Lyon
15.10
Fix Released
High
Son Nguyen

Bug Description

I noticed this warning message when deleting a journal. I'm not sure whether the journal has to have embedded images in an entry or not, but here's what I did.

1. Create a journal
2. Create a journal entry
3. Use the TinyMCE image button to embed an image in the journal entry
4. Select the journal entry in a journal entry block on a page
5. Delete the page
6. Delete the journal

Result:

[WAR] 75 (lib/embeddedimage.php:176) Invalid argument supplied for foreach()
Call stack (most recent first):

    log_message("Invalid argument supplied for foreach()", 8, true, true, "/home/aaronw/www/mahara/htdocs/lib/embeddedimage.p...", 176) at /home/aaronw/www/mahara/htdocs/lib/errors.php:441
    error(2, "Invalid argument supplied for foreach()", "/home/aaronw/www/mahara/htdocs/lib/embeddedimage.p...", 176, array(size 3)) at /home/aaronw/www/mahara/htdocs/lib/embeddedimage.php:176
    EmbeddedImage::delete_embedded_images("blog", "58") at /home/aaronw/www/mahara/htdocs/artefact/blog/index.php:56
    delete_blog_submit(object(Pieform), array(size 3)) at Unknown:0
    call_user_func_array("delete_blog_submit", array(size 2)) at /home/aaronw/www/mahara/htdocs/lib/pieforms/pieform.php:532
    Pieform->__construct(array(size 4)) at /home/aaronw/www/mahara/htdocs/lib/pieforms/pieform.php:162
    Pieform::process(array(size 4)) at /home/aaronw/www/mahara/htdocs/lib/pieforms/pieform.php:71
    pieform(array(size 4)) at /home/aaronw/www/mahara/htdocs/artefact/blog/lib.php:461
    ArtefactTypeBlog::delete_form(58) at /home/aaronw/www/mahara/htdocs/artefact/blog/index.php:28

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

Patch for "15.04_STABLE" branch: https://reviews.mahara.org/5211

Revision history for this message
Robert Lyon (robertl-9) wrote :

This problem is due to the a blogpost embedded image being embedded correctly now and so isn't an attached child, but there is a bit of code to remove the attached images that fails.

We need to keep this code but check if there is any results returned.

The problem is fixed in 15.10 already - so I'll make a fix for 15.04

Revision history for this message
Mahara Bot (dev-mahara) wrote :

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

Revision history for this message
Robert Lyon (robertl-9) wrote :

Have changed the status of this as Son has added a patch that deals with more of the different places that embedded images exist

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

Reviewed: https://reviews.mahara.org/5211
Committed: https://git.nzoss.org.nz/mahara/mahara/commit/dc680af3e7cfe687671843465150ea6276c47387
Submitter: Jono Mingard (<email address hidden>)
Branch: 15.04_STABLE

commit dc680af3e7cfe687671843465150ea6276c47387
Author: Robert Lyon <email address hidden>
Date: Fri Sep 4 11:51:04 2015 +1200

Bug 1489284: Check for blogpost embedded images as attachments

Before trying to loop through them

behatnotneeded

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

Revision history for this message
Mahara Bot (dev-mahara) wrote :

Reviewed: https://reviews.mahara.org/5226
Committed: https://git.nzoss.org.nz/mahara/mahara/commit/740c0fa739a3c1444c73988db07cdee2a6fe0376
Submitter: Son Nguyen (<email address hidden>)
Branch: master

commit 740c0fa739a3c1444c73988db07cdee2a6fe0376
Author: Son Nguyen <email address hidden>
Date: Mon Sep 7 10:04:35 2015 +1200

Handle embedded image deletion better. Bug 1489284

Refactor updating embedded images

Deals with the deleting of embedded images in a:
- blog
- forum post
- forum topic
- group description
- note
- page description

Also sorts out the problem where a note embedded item can be saved
with both 'editnote' and 'textbox' resourcetype. We only need one.

Also add 'static' to EmbeddedImage::methods()

behatnotneeded

Change-Id: Ife1f9dee5ffe9eae4468eadb8f46a16a0a2a9044

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

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

Reviewed: https://reviews.mahara.org/5606
Committed: https://git.nzoss.org.nz/mahara/mahara/commit/7a7754ec0435131d72858dc1d7ebfa0d0d25a31c
Submitter: Aaron Wells (<email address hidden>)
Branch: 15.10_STABLE

commit 7a7754ec0435131d72858dc1d7ebfa0d0d25a31c
Author: Son Nguyen <email address hidden>
Date: Mon Sep 7 10:04:35 2015 +1200

Handle embedded image deletion better. Bug 1489284

Refactor updating embedded images

Deals with the deleting of embedded images in a:
- blog
- forum post
- forum topic
- group description
- note
- page description

Also sorts out the problem where a note embedded item can be saved
with both 'editnote' and 'textbox' resourcetype. We only need one.

Also add 'static' to EmbeddedImage::methods()

behatnotneeded

Change-Id: Ife1f9dee5ffe9eae4468eadb8f46a16a0a2a9044

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

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

Reviewed: https://reviews.mahara.org/5610
Committed: https://git.nzoss.org.nz/mahara/mahara/commit/fddcc9c7bb8fb70c7de7887be5c47ec5f91b042f
Submitter: Aaron Wells (<email address hidden>)
Branch: master

commit fddcc9c7bb8fb70c7de7887be5c47ec5f91b042f
Author: Son Nguyen <email address hidden>
Date: Fri Oct 23 14:50:52 2015 +1300

Fix error when upgrading from 1.10. Bug 1489284

behatnotneeded

Change-Id: I55734b2c42c5f67a0a324de306083b9e033394be

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

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

Reviewed: https://reviews.mahara.org/5612
Committed: https://git.nzoss.org.nz/mahara/mahara/commit/d4768a1d7ac474a5e367e1d91efac7e7cfac9592
Submitter: Aaron Wells (<email address hidden>)
Branch: 15.10_STABLE

commit d4768a1d7ac474a5e367e1d91efac7e7cfac9592
Author: Son Nguyen <email address hidden>
Date: Fri Oct 23 14:50:52 2015 +1300

Fix error when upgrading from 1.10. Bug 1489284

behatnotneeded

Change-Id: I55734b2c42c5f67a0a324de306083b9e033394be

Robert Lyon (robertl-9)
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.