Images are not accessible anymore in text areas

Bug #1400140 reported by Kristina Hoeppner
18
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Mahara
Fix Released
High
Son Nguyen

Bug Description

See https://mahara.org/interaction/forum/topic.php?id=6592

Prior to Mahara 1.10, it was possible to link to images in text boxes and they would appear (see https://mahara.org/partners for example). This is not possible anymore and a broken image appears no matter what permissions are set for the page.

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

I couldn't replicate the issue. I was able to successfully put images into a TinyMCE text box in Mahara 1.10.1 and 15.04dev, using the same method I did in Mahara 1.9.

1. Clean install of Mahara 1.9
2. Create a page called "Public files page", make this page accessible to the public.
3. Put an Image block in "Public files page", and make it display an image of NZ Premier Henry Sewell.
4. Display the "Public files page", right click on the picture of Henry Sewell, and do "Copy Image Location" to obtain the image URL.
4. Create a second page called "Images in text"
5. Place a "Text box" block in this second page.
6. In the Text box's TinyMCE area, click the TinyMCE image button, and paste in the URL for the image.
7. Save the page.

Result: When I load the "Images in text" page, the image of Henry Sewell is visible no matter which user is viewing the page.

I then upgraded to Mahara 1.10, and added a second text box with another image of Henry Sewell in it, which also was visible, along with the image from before the upgrade. I had the same result when I upgraded to 15.04dev.

Are you doing something different?

One strange thing I noticed is that the image URL, in the public files page was http://vegas.wgtn.cat-it.co.nz/mahara/htdocs/artefact/file/download.php?file=5&view=6, but when I pasted it into the images in text page, an extra view ID was pasted on and it became: http://vegas.wgtn.cat-it.co.nz/mahara/htdocs/artefact/file/download.php?file=5&view=7&view=6. But this happened in Mahara 1.9 as well as in Mahara 1.10.

Cheers,
Aaron

Revision history for this message
Kristina Hoeppner (kris-hoeppner) wrote :

Hi Aaron,

We are not talking about putting images into the "Public" folder on the site level, but just into a regular folder in a user's file area. That worked before but doesn't anymore.

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

Hi Kristina,

If you read my test scenario closely, you'll see that's what I'm talking about as well. I just titled the page that I put the images in, "Public files page".

To summarize my test case, what I did was:

1. Put the image into an image block on a page.
2. Make the page viewable to the public
3. Then copy the URL from the image on that publicly-viewable page, and paste that URL into a text field elsewhere on the site.

Following that technique, I wasn't able to replicate the problem. If you're doing something different, please describe your test case. :)

Can you also check and see if this problem is still around now that we've merged in Bug 1399054?

Cheers,
Aaron

Revision history for this message
Kristina Hoeppner (kris-hoeppner) wrote :

You should not need your first step. We don't use that on the Mahara Partners page and the image is still visible. If you have to put the image into a block on the page first and then re-use it in a text block then you have the image on the page twice which doesn't always work.

So the test case that doesn't work for me is:

1. Upload an image and copy its URL.
2. Link to the image in a text box.
3. Make the page viewable to the public / secret URL.
4. The image should be displayed when you are not logged in, but it isn't.

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

The images on the Mahara Partners page ( https://mahara.org/partners/ ) are, in fact, in the sitewide "Public" files folder. So they're kind of a special case.

But I see what you mean. I followed the replication instructions in a Mahara 1.9 instance, and the image remains visible even after I log out. When I follow the same instructions in Mahara 1.10 with a "Note" block, it works as per Mahara 1.9. When I follow the instructions with a "Text" block, it does not work.

So apparently there's some code in the old-text/new-note block that identifies all the images in it by URL and provides permission to view them. We'll need to port that over to the Text block as well. Hm, actually I think the code for Bug 1399054 will, in fact, take care of this for 15.04, so it's just a bug that we'll need to fix for 1.10.

no longer affects: mahara/15.04
Changed in mahara:
milestone: 15.04.0 → 1.10.2
Revision history for this message
Aaron Wells (u-aaronw) wrote :

Yep, I just verified that this problem is fixed in 15.04 by the Bug 1399054 code. So we just need a fix for the 1.10 series.

Changed in mahara:
assignee: Aaron Wells (u-aaronw) → nobody
no longer affects: mahara/1.10
Changed in mahara:
status: Incomplete → Confirmed
Revision history for this message
Son Nguyen (ngson2000) wrote :

In mahara 1.9, the image which is linked in the page description does not show up, while the image linked in a text box of the page does.
I think we need to fix it for mahara 1.9

Revision history for this message
Son Nguyen (ngson2000) wrote :

I will file a bug related to the above issue.

Son Nguyen (ngson2000)
no longer affects: mahara/1.9
Changed in mahara:
assignee: nobody → Son Nguyen (ngson2000)
status: Confirmed → In Progress
Revision history for this message
Mahara Bot (dev-mahara) wrote : A patch has been submitted for review

Patch for "1.10_STABLE" branch: https://reviews.mahara.org/4126

Revision history for this message
Kristina Hoeppner (kris-hoeppner) wrote :

We are going to fix this in 15.04 because this patch would involve a database change.

Changed in mahara:
milestone: 1.10.2 → 15.04.0
Revision history for this message
Son Nguyen (ngson2000) wrote :

This bug has been fixed for 15.04

Changed in mahara:
status: In Progress → Won't Fix
Revision history for this message
Aaron Wells (u-aaronw) wrote :

We try to avoid database upgrades in minor version updates, but since this is a "high" priority bug with quite visible effects, I think it's worth putting a fix for it into the next 1.10 minor release.

Changed in mahara:
milestone: 15.04.0 → 1.10.3
status: Won't Fix → Confirmed
Revision history for this message
Robert Lyon (robertl-9) wrote :

The patch doesn't actually have any db upgrades in it - not sure where that idea came from

Revision history for this message
Son Nguyen (ngson2000) wrote :

Hi Robert,

The patch is not complete. We need to update the view_artefact table to access the image when public the page

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

Reviewed: https://reviews.mahara.org/4126
Committed: http://gitorious.org/mahara/mahara/commit/f7ca17cc725f593cbcc9e308349ea8c3a6f0237c
Submitter: Robert Lyon (<email address hidden>)
Branch: 1.10_STABLE

commit f7ca17cc725f593cbcc9e308349ea8c3a6f0237c
Author: Son Nguyen <email address hidden>
Date: Wed Jan 7 08:32:38 2015 +1300

Allow images in Text blocks accessible. Bug 1400140

- Append view id to image urls in Text block when viewing
- Update the table 'view_artefact' when adding/editting
urls of a Text block
- Add missing referred artefacts for existing database

Change-Id: I6b1ed5ca46b2642b0624df9027964043b4dc39a8
Signed-off-by: Son Nguyen <email address hidden>

Robert Lyon (robertl-9)
Changed in mahara:
status: Confirmed → Fix Committed
Son Nguyen (ngson2000)
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.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.