Dotclear

Ticket #1915 (closed defect: wontfix)

Opened 12 years ago

Last modified 8 years ago

Exception when putting twice an unset setting

Reported by: bruno Owned by: team
Priority: normal Milestone:
Component: module:core Version: 2.6.1
Severity: normal Keywords:
Cc:

Description

When using the following piece of code :

$core->blog->settings->addNamespace('test');
$core->blog->settings->test->put('foo','bar','string');
$core->blog->settings->test->put('foo','bar','string');

The exception " Uncaught exception 'Exception' with message 'columns setting_ns, setting_id, blog_id are not unique " is raised.

Explanation : when adding/updating a setting, the database is updated, but the object is not updated. Therefore, when performing the second put, the object thinks that the setting is not set, and then tries to insert its value in the base whereas it already exists.

The object should be updated when the database is updated to prevent this strange behavior.

The example is quite idiot, but can occur sometines in weird situations (for instance when a plugin is installed and a behavior is called after a triggerblog)

Change History

comment:1 Changed 12 years ago by bruno

This is a variant of ticket ... #185

comment:2 Changed 8 years ago by franck

  • Status changed from new to closed
  • Resolution set to wontfix
  • Milestone A definir deleted

Fix : don't unset twice a setting :-)

Note: See TracTickets for help on using tickets.

Sites map