0
Welcome Guest! Login
0 items Join Now

Substring bug breaks Presets when adding features

    • evilC's Avatar
    • evilC
    • Jr. Rocketeer
    • Posts: 39
    • Thanks: 0

    Substring bug breaks Presets when adding features

    Posted 12 years 7 months ago
    • Testing method:
      Fresh copy of Quasar.
      Joomla 1.5

      Edit templateDetails.xml, add the following code in the settings section:
                     <param name="xxx" type="chain" label="Setting 1" description="">
                          <param name="enabled" type="toggle" default="0" label="enable" enabler="true" setinsession="true" setbysession="true" setincookie="true" setbycookie="true" />
                          <param name="image" type="text" default="" label="image" setinsession="true" setbysession="true" setincookie="true" setbycookie="true" />
                     </param>
       
                     <param name="yyy" type="chain" label="Setting 2" description="">
                          <param name="enabled" type="toggle" default="0" label="enable" enabler="true" setinsession="true" setbysession="true" setincookie="true" setbycookie="true" />
                          <param name="image" type="text" default="" label="image" setinsession="true" setbysession="true" setincookie="true" setbycookie="true" />
                     </param>

      Edit gantry.config.php to add these lines to preset 1
                     'xxx-image' => '1',
                     'xxx-enabled' => '0',
       
                     'yyy-image' => '1',
                     'yyy-enabled' => '0',
      Add these lines to preset 2:
                     'xxx-image' => '2',
                     'xxx-enabled' => '1',
       
                     'yyy-image' => '2',
                     'yyy-enabled' => '1',
      Add these lines to all other presets:
                     'xxx-image' => '',
                     'xxx-enabled' => '0',
       
                     'yyy-image' => '',
                     'yyy-enabled' => '0',

      So, for Presets 1 and 2 we should see the preset number appear in the Setting 1 and Setting 2 "image" box, and the switch be off for Preset 1 and on for Preset 2.
      All other presets would be blank/off.

      So, now to break something!

      In both files, search and replace yyy with xxxx (Make Setting 2 a substring of Setting 1 )
      Result: Setting 2 does not change when you click on a preset.
    • evilC's Avatar
    • evilC
    • Jr. Rocketeer
    • Posts: 39
    • Thanks: 0

    Re: Substring bug breaks Presets when adding features

    Posted 12 years 7 months ago
    • OK, this is REALLY wierd

      If you name them xxx-xxx and xxx-yyy, then setting 2 breaks (Can sort of understand this one, - is meant to be chain separator)

      If you name them xxx_xxx and yyy_yyy, setting 2 breaks
      If you rename them to xxx_xx and yyyy_yyy (Note one extra y) then it works.

      Some kind of wierd regex problem?

Time to create page: 0.033 seconds