Ticket #141 (closed enhancement: fixed)
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 &).
//
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.
