Announcement

  •  » Engine
  •  » [resolved] conf_update_param doesn't update $conf

#1 2014-02-03 22:06:52

LucMorizur
Member
Vienne (Isère) - France
2009-04-30
168

[resolved] conf_update_param doesn't update $conf

Hi;

I just discovered that function conf_update_param (in include/functions.inc.php) updates the database, but doesn't update global variable array $conf. This creates a small bug in [extension by Eric] LCAS, as $conf is used immediately after using conf_update_param to display the new configuration. Thus the configuration shown is the old one, though parameters are properly stored in the database (and thus the displayed config is correct after updating or reloading the page).

Is this functionning intended, or shall I open a ticket in the bugtracker?


Our gallery : Le Site à Nous (a silly name in french, but here I don't care ;-) ! )
An event, a new gallery ? Plugin Event Cats
My test gallery : Tests Piwigo de Luc
Thanksalot for this beautiful project.

Offline

 

#2 2014-02-03 22:10:46

mistic100
Former Piwigo Team
Lyon (FR)
2008-09-27
3271

Re: [resolved] conf_update_param doesn't update $conf

Hi

Without being intented I didn't changed it when I saw it because I guess it can cause bugs to change the behavior of the method.
But it could have been changed for 2.6 (major release, compatibility breaks, etc.)

And the solution is simple : update $conf yourself :-)

Offline

 

#3 2014-02-03 22:12:01

flop25
Piwigo Team
2006-07-06
6918

Re: [resolved] conf_update_param doesn't update $conf

indeed we have to load_conf_from_db


To get a better help : Politeness like Hello-A link-Your past actions precisely described
Check my extensions : more than 30 available
who I am and what I do : http://fr.gravatar.com/flop25
My gallery : an illustration of how to integrate Piwigo in your website

Offline

 

#4 2014-02-03 22:13:14

mistic100
Former Piwigo Team
Lyon (FR)
2008-09-27
3271

Re: [resolved] conf_update_param doesn't update $conf

That's overkill

Offline

 

#5 2014-02-03 22:14:20

flop25
Piwigo Team
2006-07-06
6918

Re: [resolved] conf_update_param doesn't update $conf

mistic100 wrote:

That's overkill

that's only once a admin form for options is send so that's once every... months?


To get a better help : Politeness like Hello-A link-Your past actions precisely described
Check my extensions : more than 30 available
who I am and what I do : http://fr.gravatar.com/flop25
My gallery : an illustration of how to integrate Piwigo in your website

Offline

 

#6 2014-02-03 22:18:01

mistic100
Former Piwigo Team
Lyon (FR)
2008-09-27
3271

Re: [resolved] conf_update_param doesn't update $conf

I didn't say it is unoptimized :-)

Personally I always build $conf['myplugin'] from config form and give it to conf_update_param
That way I am always sure what it is in DB and it clean potentially corrupted config

Offline

 

#7 2014-02-04 23:10:26

LucMorizur
Member
Vienne (Isère) - France
2009-04-30
168

Re: [resolved] conf_update_param doesn't update $conf

Well, I chose to build $conf['LoginCaseAccentsSensitivity'] before updating the DB...

But I think that for version 2.7, it would be logical to update $conf in function conf_update_param...

Thanks!


Our gallery : Le Site à Nous (a silly name in french, but here I don't care ;-) ! )
An event, a new gallery ? Plugin Event Cats
My test gallery : Tests Piwigo de Luc
Thanksalot for this beautiful project.

Offline

 

#8 2014-02-04 23:25:46

mistic100
Former Piwigo Team
Lyon (FR)
2008-09-27
3271

Re: [resolved] conf_update_param doesn't update $conf

Offline

 
  •  » Engine
  •  » [resolved] conf_update_param doesn't update $conf

Board footer

Powered by FluxBB

github twitter facebook google+ newsletter Donate Piwigo.org © 2002-2019 · Contact