Overridden site admin fields not disabled unless also stored in database

Bug #803955 reported by Andrew Nicols
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Fix Released
Low
Andrew Nicols

Bug Description

If you explicitly set a field in config.php, then it /should/ be disabled in admin/site/options.php
This currently only happens if that setting is also stored in the database.

As a result, users believe that they can change the option, but when they then try to, the option is unset, the field greyed out, and there is no message informing them that they can't change the setting.

This appears to stem from the way that the $OVERRIDDEN variable is filled in lib/mahara.php->load_config().

At present, this grabs all config options set in the database.
For any option in the database, it then checks for an override, and if it's already present in $CFG, it adds this to the OVERRIDDEN array. If it isn't present in $CFG already, it adds it to $CFG so that it's accessible.

Have a patch to submit for this.

Affects 1.4.x and master

Revision history for this message
Andrew Nicols (dobedobedoh) wrote :
Changed in mahara:
status: New → In Progress
Revision history for this message
Andrew Nicols (dobedobedoh) wrote :

This increases the amount of fields held in the $OVERRIDDEN. I don't think that this is a major problem as only the field name is stored in the array, not the field value.

This doesn't handle plugin setting overrides, but none of the plugins handle this at present anyway.

Revision history for this message
François Marier (fmarier) wrote :

Let's do this on master only since it's not fixing a major bug and there is a potential to break things (or change the behaviour of Mahara).

Changed in mahara:
milestone: 1.4.1 → 1.5.0
Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/420
Committed: http://gitorious.org/mahara/mahara/commit/1744120c630d6196575ac98df7b135b321176ee5
Submitter: Hugh Davenport (<email address hidden>)
Branch: master

commit 1744120c630d6196575ac98df7b135b321176ee5
Author: Andrew Robert Nicols <email address hidden>
Date: Thu Jun 30 16:58:27 2011 +0100

    Fill $OVERRIDDEN with all variables set in config.php

    See bug #803955

    This does mean that $OVERRIDDEN will also get a list of database fields and
    plugins, but I think that more fields, is better than too few.

    Change-Id: I3fef6277484e48d5ec4c1609fbe1178f976333f6
    Signed-off-by: Andrew Robert Nicols <email address hidden>

Changed in mahara:
status: In Progress → Fix Committed
Melissa Draper (melissa)
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.