Problem with deleting skins that are attached to a portfolio page
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
| Mahara |
High
|
Son Nguyen | ||
| 1.8 |
High
|
Son Nguyen | ||
| 1.9 |
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.
Kristina Hoeppner (kris-hoeppner) wrote : | #1 |
Changed in mahara: | |
importance: | Undecided → High |
status: | New → Confirmed |
milestone: | none → 1.9.0 |
Kristina Hoeppner (kris-hoeppner) wrote : | #2 |
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.
Son Nguyen (ngson2000) wrote : | #3 |
https:/
Reviewed: https:/
Committed: http://
Submitter: Robert Lyon (<email address hidden>)
Branch: master
commit 36ee490efe7e4fd
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: I64faac110c8caa
Signed-off-by: Son Nguyen <email address hidden>
Robert Lyon (robertl-9) wrote : | #5 |
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.
Aaron Wells (u-aaronw) wrote : | #6 |
I noticed that patch 2850 adds a string that needs to be pluralized. See https:/
Mahara Bot (dev-mahara) wrote : | #8 |
Reviewed: https:/
Committed: http://
Submitter: Robert Lyon (<email address hidden>)
Branch: master
commit 14e924a1c167e51
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: Ia72e189b1b0b14
Signed-off-by: Son Nguyen <email address hidden>
Patch for "master" branch: https:/
Mahara Bot (dev-mahara) wrote : | #9 |
Reviewed: https:/
Committed: http://
Submitter: Son Nguyen (<email address hidden>)
Branch: master
commit cebec827e8a1c80
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: I58b3bed8b99093
Signed-off-by: Robert Lyon <email address hidden>
Mahara Bot (dev-mahara) wrote : | #12 |
Patch for "1.8_STABLE" branch: https:/
Son Nguyen (ngson2000) wrote : | #11 |
https:/
Reviewed: https:/
Committed: http://
Submitter: Robert Lyon (<email address hidden>)
Branch: 1.8_STABLE
commit 768c1656206bc21
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: I64faac110c8caa
Signed-off-by: Son Nguyen <email address hidden>
Changed in mahara: | |
status: | Fix Committed → Fix Released |
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?