[ic] Unexpected interpolation of [discount-price]

John Rennie interchange-users@icdevgroup.org
Tue Feb 4 16:59:00 2003


Hi all,

There are occasions (specifically when it's viewed for editing on a
page or component in the UI) when [discount-price] is converted from
a tag into $0.00, when it shouldn't be interpolated -- just as other
tags aren't converted.

For example, create a new page, enter [discount-price] as the
content. Save the page, then get the UI to reload it. The content
is now $0.00 (just confirmed in latest demo on web).

I've (sort of) tracked this down to the following statement 
(starts on line 4668 in revision 2.145 of Interpolate.pm):

  $run =~ s!$B$QR{_discount_price}!
          currency(
            discount_price($item, item_price($item,$1), $1 || 1)
                             , $2
                            )!ge
          or
            $run =~ s!$QR{discount_price}!
                    currency(
                      discount_price($item, item_price($item,$1), $1 ||
1)
                                        , $2
                                        )!ge;

If the section after the 'or' is removed, then the editor works fine
- but this breaks operation of this tag in normal use :(

Any got any ideas for the correct fix? I've learnt a lot about
Interchange internals by tracking this, but not enough!

BTW, the tag is used in the 'Shopping cart (full)' component in the
current
Foundation demo, and you can see the same problem if you edit that in
the
(otherwise excellent) new component editor.

Thanks,

John.