Can't edit group homepage template on upgraded site
Bug #1369315 reported by
Kristina Hoeppner
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Mahara |
Fix Released
|
High
|
Robert Lyon |
Bug Description
Mahara 1.10 dev:
I upgraded my user manual Mahara instance from Mahara 1.9 to 1.10dev, but don't have an edit button for the group homepage template under Admin -> Config site -> Pages. I do see one on a fresh install.
Changed in mahara: | |
status: | New → Triaged |
importance: | Undecided → High |
status: | Triaged → Incomplete |
Changed in mahara: | |
status: | Incomplete → Invalid |
Changed in mahara: | |
status: | Invalid → In Progress |
Changed in mahara: | |
assignee: | nobody → Robert Lyon (robertl-9) |
Changed in mahara: | |
status: | In Progress → Fix Committed |
Changed in mahara: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
Hi Kristina,
Ok, I've not been able to replicate yet but what I think has happened is this.
In the template for displaying that page is:
{if !$view.submittedto && (!$view.locked || $editlocked)}
... display the edit button ...
{/if}
So I suspect in your case the view is locked for some reason.
You can check this out by looking at the db for the site page templates by going:
SELECT v.* FROM "view" v WHERE v.owner = 0 ORDER BY v.title, v.id;
and seeing if any of the results have locked = 1
If it is the case that locked = 1 then I think the problem is caused by the following code in the db/upgrade.php script:
if ($oldversion < 2014022400) { sql_array( "SELECT v.owner FROM {view_artefact} va
LEFT JOIN {view} v on v.id = va.view
LEFT JOIN {artefact} a on a.id = va.artefact
WHERE (v.submittedgroup IS NOT NULL OR v.submittedhost IS NOT NULL)", array());
require_ once(get_ config( 'docroot' ) . 'artefact/ lib.php' );
ArtefactType: :update_ locked( $record- >owner) ;
// Make sure artefacts are properly locked for submitted views.
// Can be a problem for older sites
$submitted = get_records_
if ($submitted) {
foreach ($submitted as $record) {
}
}
}
I suspect something in your mahara instance had some views submitted and somehow that made the group homepage template get marked as locked for some reason.