Complex bound name not being carried across _QLButton
Summary:
Eric's original email, Sept 10, 2021:
Not high priority, I have a workaround, but for future reference.
Overview
1) I have a _QLButton.
2) Its QL binds a bunch of names, then creates another (inner) _QLButton.
3) The inner _QLButton uses a bunch of the bound names in a _notify call.
Some of the bound names work fine (yaaaaay!), but one of them results in an error ("_notify parameter body should be of type Parsed Text Type but is actually Value has not been set"). If I replace the bound name with exactly the same expression bound to it, there's no error.
Details
The bound names are
+$this-release
<.9v5kahj, .7w4geu6> -> +$notify-recipients
$this-release -> Name -> +$notify-subject
$this-release -> ""[[Notes]]
[[Downloads -> ""<a href="[[URL]]"><b>[[Name]]</b></a>"" -> _bulleted]]"" -> +$notify-body
It's the last one, $notify-body, that's causing the problem - whether I define it as above, or put $this-release inside the ""...."" block (i.e., referencing [[$this-release -> Notes]] and [[$this-release -> Downloads -> ....]]), when I click the QLButton I get _notify parameter body should be of type Parsed Text Type but is actually Value has not been set.
If I replace the bound name with the exact thing I was binding to the name, i.e.
_notify(recipients=$notify-recipients, subject=$notify-subject, body=$notify-body, thing=$this-release, topic=""Release"")
becomes
_notify(recipients=$notify-recipients, subject=$notify-subject, body=$this-release -> ""[[Notes]]
[[Downloads -> ""<a href="[[URL]]"><b>[[Name]]</b></a>"" -> _bulleted]]"", thing=$this-release, topic=""Release"")
then it works fine.
Sounds like the two levels of _QLButton are losing the binding. That's not entirely surprising, but certainly isn't desireable. Also, note that we are clearly violating referential transparency here. What's going wrong, and how do we fix it?
It may be time for a rethink of how bound names carry about _QLButtons. Can we come up with a less fragile approach?