Uploading new image as skin background gives error

Bug #1782729 reported by Marion MacDonald
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Fix Released
High
Robert Lyon

Bug Description

Hello

I was testing in preparation for an upgrade from v 17.04 to 18.04 and found that I couldn't upload a new image as a background to a skin. I've tried on demo.mahara.org and this is what I've found:

I created a new skin. Went into the Background tab and clicked on Add a File. Moving between folders brings me back to the Background tab; I would expect it to list the files in the selected folder. This happens even if there are image files in the selected folder.

Clicking on Add a File again then shows the list of files and I can then select an image file and close the dialog box. I am taken back to the Background tab and the image file is displayed.

Clicking on Save at that point gives:

Mahara Demo: Site unavailable
A nonrecoverable error occurred. This probably means you have encountered a bug in the system

Suspect there's an explanation for this. If I first upload an image file (256x256, PNG, 34k) into my Content-Files area, I can go through the above process select the image file and it saves OK. The image files I had tried previously on the demo site was percy.png which is a profile image, 11k, PNG, 100x100 but this error has occurred consistently on our dev site regardless of the image selected.

Regards
Marion

Browser Firefox 61.0.1
Windows 7
Not sure of db on demo.mahara.org; I think our dev site has MySQL

Revision history for this message
Steven (stevens-q) wrote :

Preconditions:
-------------------
1. Testing was done on the following
--- a. URL = demo.mahara.org
--- b. Firefox 61.0.1 Windows 7
3. User has multiple folders for their account
4. User has saved a profile image - NOTE: this will create a folder and save the image in it
5. User has folder with uploaded images in it

Test Script: upload an image to be used as backgrounds image on portfolio page
-------------------
1. User browse to Main menu > Portfolio > Skins - create a new skin
2. User click the Background tab
3. User click the Add a File button
4. User select a folder
5. Confirm that when a folder is selected - the folder contents are displayed ✘
6. Select the image from the folder which contains the profile image used when setting up a profile image for your account by reopening the modal window
7. Click the save button
8. Confirm that the image is displayed as the background image for the shin ✘

Revision history for this message
Steven (stevens-q) wrote :

[BUG] - Navigating between folders closes the modal window

Summary: User wants to add a background image for a skin. When user tries to add a file, a modal is displayed, displaying the users folders. Browsing between the folders will cause the modal window to close which is a bug

Test steps:
1. User browse to Main menu > Portfolio > Skins - create a new skin
2. User click the Background tab
3. User click the Add a File button
4. User select a folder

Actual result: the modal window is closed and upon reopening the modal window, the folder contents are now displayed

Expected result: When a folder is selected -
--- a. the folder contents should be displayed.
--- b. Navigating through different folders should not close the modal window.
--- c. selecting an image by clicking the checkmark icon should:
------ * Close the modal window
------ * The image should be displayed on the Create skin > background page

Catalyst QA

Revision history for this message
Steven (stevens-q) wrote :

[BUG] - Profile images should not be used as background images for skins

Summary: When adding an image to be used as background for a skin, The user sees the folder created when user uploads an image for thier profile picture. Selecting this image will cause an error message to be displayed "Mahara: Site unavailable"

Test Steps :

1. User browse to Main menu > Portfolio > Skins - create a new skin
2. User click the Background tab
3. User click the Add a File button
4. User select the folder that contains profile picture images

Actual result: after selecting a profile picture image and clicking save button, an error message is displayed as follows "Mahara: Site unavailable"

Expected result: The folder created when a user uploads a profile picture image should not be displayed when a user adds a file to be used for a background image for a skin.

Catalyst QA

NOTE: Dev has said that the artefact chooser for skins is not the same as is used in the rest of the Mahara site

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

Robert Lyon (robertl-9)
Changed in mahara:
assignee: nobody → Robert Lyon (robertl-9)
milestone: none → 18.10.0
status: New → In Progress
importance: Undecided → High
Revision history for this message
Steven (stevens-q) wrote :

Bug Fixed

[BUG] - Profile images should not be used as background images for skins ✔

When user tries to add a file as a background image

1. User can still see the images folder created when a user uploads a profile picture for the first time.

2. The user cannot see the images inside the folder that were used for profile pictures. Folder appears empty.

Catalyst QA Approved ✔

Revision history for this message
Steven (stevens-q) wrote :

Bug Partially Fixed

[BUG] - Navigating between folders closes the modal window

The user is now able to navigate through their folders to find images without the modal window closing. ✔
-----------------------
Not fixed
-----------------------

However when an image is selected (clicking the check mark icon), the modal window will stay open, as it did before, until the user clicks outside of the modal window ✘

c. selecting an image by clicking the checkmark icon should:
--- * Close the modal window
--- * The image should be displayed on the Create skin > background page

Catalyst QA Failed Testing

Revision history for this message
Steven (stevens-q) wrote :

Bug Fixed

 when an image is selected (clicking the check mark icon), the modal window will now close as expected

Catalyst QA Approved ✔

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

Reviewed: https://reviews.mahara.org/9024
Committed: https://git.mahara.org/mahara/mahara/commit/6c5373d6abd9728a19bb839f6da384ef83377549
Submitter: Cecilia Vela Gurovic (<email address hidden>)
Branch: master

commit 6c5373d6abd9728a19bb839f6da384ef83377549
Author: Robert Lyon <email address hidden>
Date: Mon Jul 23 12:19:22 2018 +1200

Bug 1782729: Adjust skin form to submit via javascript

In the past there was 2 filebrowser fields, body background and view
background, in the skin edit form and this meant we couldn't submit
the form by js as it confused things.

But now we only have the body background image option so I've altered
the form so that it submits via javascript.

In doing so it gets the changing folder to work as expected as well.

I've also restricted the images one can use to non-profile ones as
that was causing an error on valid image check.

behatnotneeded

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

Changed in mahara:
status: In Progress → Fix Committed
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.