Comment 1 for bug 1369315

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

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) {
        // Make sure artefacts are properly locked for submitted views.
        // Can be a problem for older sites
        $submitted = get_records_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());
        if ($submitted) {
            require_once(get_config('docroot') . 'artefact/lib.php');
            foreach ($submitted as $record) {
                ArtefactType::update_locked($record->owner);
            }
        }
    }

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.