Opened 3 years ago

Closed 3 years ago

#1486368 closed Bugs (fixed)

r3102 breaks plugin configuration defaulting

Reported by: brandond Owned by: thomasb
Priority: 3 Milestone: 0.4-beta
Component: Plugin API Version: git-master
Severity: normal Keywords:
Cc:

Description

A number of plugins rely on being able to load a default set of configuration variables, and then overwriting those with a second set. This looks like:

$this->load_config('config/config.inc.php.dist');
if(file_exists("./plugins/forward_as_attachment/config/config.inc.php"))
  $this->load_config('config/config.inc.php');

The 'forward as attachment' plugin is one public plugin that does this, and we have several other in-house plugins that rely on this behavior as well. r3102 broke this behavior by not allowing load_config to overwrite existing properties when called by a plugin.

This is, to us, a major regression.

Change History (4)

comment:1 Changed 3 years ago by rosali

@brandond:

I have fixed my plugins meanwhile to work with SVN3102++

if(file_exists("./plugins/forward_as_attachment/config/config.inc.php"))

$this->load_config('config/config.inc.php');

else

$this->load_config('config/config.inc.php.dist');

comment:2 Changed 3 years ago by alec

  • Milestone changed from later to 0.4-beta
  • Owner set to thomasb

comment:3 Changed 3 years ago by thomasb

The changes in [3597cc2c] were made because plugin configs could override user settings. Maybe we need make a major change in the way how user settings are merged over the config properties.

comment:4 Changed 3 years ago by thomasb

  • Resolution set to fixed
  • Status changed from new to closed

Fixed in [b545d3e8]. Each set of configuration parameters overwrites existing values but user prefs will always be merged over all of them.

Note: See TracTickets for help on using tickets.