ApiExplorer - Fix formatting of getvalue return field
authorColeman Watts <coleman@civicrm.org>
Sun, 4 Sep 2016 01:26:17 +0000 (21:26 -0400)
committerColeman Watts <coleman@civicrm.org>
Sun, 4 Sep 2016 01:26:17 +0000 (21:26 -0400)
templates/CRM/Admin/Page/APIExplorer.js

index 62f2fe5b2dd677b5ed6493a593519af65899dc51..5ce9482aadb85a9ae91e9fa1b35b0ea3b707ccaf 100644 (file)
     $.each(params, function(key, value) {
       var json = JSON.stringify(value),
         // Encourage 'return' to be an array - at least in php & js
-        js = key === 'return' ? JSON.stringify(evaluate(value, true)) : json,
-        php = key === 'return' ? phpFormat(evaluate(value, true)) : phpFormat(value);
+        js = key === 'return' && action !== 'getvalue' ? JSON.stringify(evaluate(value, true)) : json,
+        php = key === 'return' && action !== 'getvalue' ? phpFormat(evaluate(value, true)) : phpFormat(value);
       if (!(i++)) {
         q.php += ", array(\n";
         q.json += ", {\n";