LuceeAjax.js does not bind empty values

Description

In Lucee.ajaxProxy.invokeMethod, the javascript loops through any values that CF has requested to be bound to the proxy request, but it culls any null values here:

Lucee.ajaxProxy.invokeMethod = function(d, e, p) { var q = {}; for (var g in p) { if (typeof(p[g]) == "object") { for (var l in p[g]) { q[l] = p[g][l] } } else { if (p[g]) { // CULLING NULL VALUES q[g] = p[g] } }

Consequently, if you bind a DOM field with an empty string to your proxy object, it will not get passed at all, as opposed to being passed as an empty string. While there is an argument to be made that it should work that way, ACF does not work that way.

This is resolved in this PR (wasn't sure whether to submit it to the extension or the Lucee core):

https://github.com/lucee/extension-ajax/pull/3 – we just comment out the two 'if' lines. Presumably they were put there for a reason, so the comments were left in until this can be reviewed properly.

Activity

Michael Offner 
6 June 2019 at 19:03

please check this

Michael Offner 
3 June 2019 at 08:45
(edited)

was set to deployed because Ajax 1.0.0.2 solved the issue for me, but i did pull the PR anyway and did a new version.

Michael Offner 
3 June 2019 at 08:24

Samuel W. Knowlton 
28 May 2019 at 16:54

This remains marked as fixed in the 5.3.2 release. It is not fixed. The PR we submitted was never merged and LDEV-2115 is likely also not fixed. We asked on the mailing list (https://dev.lucee.org/t/announcing-lucee-5-3-2-rc-5-3-2-74/5388/10) and said the same thing there.

Please either accept the PR that resolves these tickets or remove the tickets from the list of fixed issues for 5.2 and 5.3. I get that legacy support for this tag is not a big issue for anyone but this has been marked fixed for months now and we have brought it to your attention on several occasions.

Samuel W. Knowlton 
6 March 2019 at 14:35

Submitted https://github.com/lucee/extension-ajax/pull/6 as a standalone fix for LDEV-2099, LDEV-2100, and LDEV-2115 (separate from PR 3 above which also contained a fix for LDEV-2028 and LDEV-2029 that should have been separate)

Fixed

Details

Assignee

Reporter

New Issue warning screen

Before you create a new Issue, please post to the mailing list first https://dev.lucee.org

Once the issue has been verified, one of the Lucee team will ask you to file an issue

Sprint

Affects versions

Priority

Created 29 November 2018 at 21:01
Updated 8 May 2020 at 19:29
Resolved 18 February 2019 at 15:16