Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2012
    Location
    mostly harmless
    Posts
    1,809
    Plugin Contributions
    8

    Default [Not a bug] Configuration 'use_function' called for display instead of update

    Background
    For some configuration options (for a plugin), I would like to call a function when the value is "updated" and only when the value is "updated". I'd like to use the built-in configuration system if possible for these options. While working with the field I noted a discrepancy between the wiki documentation and the code in configuration.php. So a "bug" of sorts in one place or the other.

    Question
    From the wiki documentation the function listed in the 'use_function' column is run on input by the user before changing 'configuration_value'. Based upon this I would expect the function to only be called when the "update" button is clicked. Is this the expected behavior (or outdated documentation)?

    Looking at 'admin/configuration.php' this file runs the 'use_function' before displaying any configuration options / values instead of when a value is updated. Is this a bug or intended behavior?
    The glass is not half full. The glass is not half empty. The glass is simply too big!
    Where are the Zen Cart Debug Logs? Where are the HTTP 500 / Server Error Logs?
    Zen Cart related projects maintained by lhûngîl : Plugin / Module Tracker

  2. #2
    Join Date
    Jun 2003
    Location
    Newcastle UK
    Posts
    2,896
    Blog Entries
    2
    Plugin Contributions
    2

    Default Re: Configuration 'use_function' called for display instead of update

    Hi,

    It is the wiki information that is incorrect. The use_function is used to transform a configuration value before displaying it.

    e.g. the configuration value may be a country id, this needs to be transformed to a countries name before displaying.

    I have updated the wiki to reflect this.

  3. #3
    Join Date
    Feb 2012
    Location
    mostly harmless
    Posts
    1,809
    Plugin Contributions
    8

    Default Re: Configuration 'use_function' called for display instead of update

    Thank You for the clarification

 

 

Similar Threads

  1. Replies: 2
    Last Post: 24 Feb 2011, 04:54 PM
  2. Replies: 4
    Last Post: 24 Jul 2010, 01:06 PM
  3. Replies: 3
    Last Post: 9 Jan 2009, 03:25 PM
  4. Possible Bug? Update Cart not functioning
    By woodlandsprite in forum Customization from the Admin
    Replies: 17
    Last Post: 23 Jun 2006, 02:07 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR