Problem with deleting skins that are attached to a portfolio page

Bug #1264105 reported by Melissa Newman
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Fix Released
High
Son Nguyen
1.8
Fix Released
High
Son Nguyen
1.9
Fix Released
High
Son Nguyen

Bug Description

1. Create a skin.
2. Attach the skin to a page.
3. Delete the skin
4. try to display the page.

the portfolio page has the message:

Not found

The page you are looking for could not be found.

Skin with id 2 not found

Expected result: When a skin is deleted that is attached to a page, the connection between the skin and the page needs to be cleared, so the page can be displayed.

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

It would good if there was a warning before deleting a skin like for deleting a file if the file is used in a page, e.g. The skin you are about to delete is used in 1 page. Do you want to proceed?

Changed in mahara:
importance: Undecided → High
status: New → Confirmed
milestone: none → 1.9.0
Revision history for this message
Kristina Hoeppner (kris-hoeppner) wrote :

If you do proceed, then the next time you open the page which had the deleted skin, you should see the theme that goes with the page because the skin is gone.

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

Reviewed: https://reviews.mahara.org/2850
Committed: http://gitorious.org/mahara/mahara/commit/36ee490efe7e4fd692b7888a54f46d1b47d23cc7
Submitter: Robert Lyon (<email address hidden>)
Branch: master

commit 36ee490efe7e4fd692b7888a54f46d1b47d23cc7
Author: Son Nguyen <email address hidden>
Date: Mon Dec 30 09:50:38 2013 +1300

Fix the issue when deleting a skin (Bug 1264105)

also display number of views using the skin to delete

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

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

Will need to run an upgrade to fix up bad data that got created before the patch was put in place.

I'm thinking a query like:
SELECT v.id AS view FROM view v WHERE v.skin IS NOT NULL AND NOT EXISTS (SELECT id FROM skin WHERE v.skin = skin.id)

should do the trick of finding the views with lost skins - so will be a matter of looping through those view ids and setting the skin value to null.

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

I noticed that patch 2850 adds a string that needs to be pluralized. See https://wiki.mahara.org/index.php/Language_Packs/Plural_forms

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

Reviewed: https://reviews.mahara.org/2875
Committed: http://gitorious.org/mahara/mahara/commit/14e924a1c167e5158c9833e9bc50fa0c489727fe
Submitter: Robert Lyon (<email address hidden>)
Branch: master

commit 14e924a1c167e5158c9833e9bc50fa0c489727fe
Author: Son Nguyen <email address hidden>
Date: Tue Jan 7 16:17:21 2014 +1300

Set the skin of a view to NULL if the skin does not exist
(Bug 1264105)

also fix the plural lang string

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

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

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

Reviewed: https://reviews.mahara.org/2997
Committed: http://gitorious.org/mahara/mahara/commit/cebec827e8a1c80c58a93a62b7ae92392560fa7b
Submitter: Son Nguyen (<email address hidden>)
Branch: master

commit cebec827e8a1c80c58a93a62b7ae92392560fa7b
Author: Robert Lyon <email address hidden>
Date: Wed Feb 12 13:38:00 2014 +1300

Fixing mistake with db select call (Bug #1264105)

- wasn't working if the site was using dbprefix on table names

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

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

Patch for "1.8_STABLE" branch: https://reviews.mahara.org/2998

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

Reviewed: https://reviews.mahara.org/2998
Committed: http://gitorious.org/mahara/mahara/commit/768c1656206bc21fda5e2c96c94f9b6d2ceb2c33
Submitter: Robert Lyon (<email address hidden>)
Branch: 1.8_STABLE

commit 768c1656206bc21fda5e2c96c94f9b6d2ceb2c33
Author: Son Nguyen <email address hidden>
Date: Mon Dec 30 09:50:38 2013 +1300

Update view's skin when deleting a skin which is attached to
(Bug 1264105)

also
- display number of views using the skin to delete
- update the existing database

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

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.