Ticket #141 (closed enhancement: fixed)

Opened 2 years ago

Last modified 2 years ago

change to xfa verb processing to support dots in xfa value

Reported by: mcnattyp@… Owned by: scorfield
Type: enhancement Priority: normal
Milestone: Fusebox 5.1 Component: Miscellaneous
Version: 5.0 Severity: normal
Keywords: Cc:

Description

I've recently discovered an idiosyncrasy with the <xfa> verb/tag which
I don't believe is desirable.

In the case of using the tag like this:
<xfa name="foo" value="bar" />

The xfa verb handler will prepend the current circuit to the xfa
value, making it a well-formed, dot-notation xfa.

However, when using the tag like this:
<xfa name="foo" value="bar&id=#attributes.id#" />

The handler does not prepend the current circuit because it finds a
dot in the variable evaluation piece of the code. The inclusion of a
dot turns off the current circuit prepending action, and in this case,
it is not the desired effect.

The fix is simple, and include looking for the dot in the first part of the xfa
value (before any & or &amp;).

//
Barney B recommends this as the change:

Replacing line 101 (of FB5.0rc1) of the XFA verb with this:

dotPos = find(".", value);
ampPos = find("&", value);
if (not fb_.verbInfo.attributes.evaluate
AND (dotPos LT 1
OR (ampPos GT 0
AND dotPos GT ampPos
)
)) {

should do it.

However, doing so will break a number of FB4.1 apps (including all of
mine), as I use the XFA-then-SET paradigm illustrated above quite
frequently. Perhaps there should be a 4.1 compatibility flag in the
fusebox.xml params that defaults to true and would disable stuff like
this, but setting it to false would allow non-compatible extra
features to start working?
//

I suggest using the fusebox.xml strictMode parameter to determine how to process the dots in xfa values. That may introduct bleeding from fusebox.xml into verbs processing - I don't know if that's an undesirable effect.

Attachments

Change History

Changed 2 years ago by scorfield

  • owner changed from sean@corfield.org to scorfield
  • status changed from new to assigned

Damien McKenna? suggested allowing <parameter> child tags to specify URL parameters that should be appended to the xfa...

Changed 2 years ago by scorfield

  • type changed from defect to enhancement

Since this would break some FB41 apps I think this is an enhancement not a defect. Still under review.

Changed 2 years ago by scorfield

After lots of discussion with Barney, here's what seems the best course of action:

1. if strictMode, disallow URL parameters in an xfa value (no &)
2. introduce a <parameter> subtag to specify URL parameters
3. if <parameter> is present, xfa value may not contain & either

Result: compatibility if not strict mode. If you don't use URL parameters in xfa values, strict mode won't affect you and you won't need <parameter> either. If you do use URL parameters in xfa values, you need to make a choice.

Changed 2 years ago by scorfield

  • status changed from assigned to closed
  • resolution set to fixed

(In [290]) Fixes #141 by adding strict check to <xfa> and allowing <parameter> with <xfa>.

Note: See TracTickets for help on using tickets.