Bug 33290 - Incorrect variable used in http-client.js
Summary: Incorrect variable used in http-client.js
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: ERM (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low normal (vote)
Assignee: Jonathan Druart
QA Contact: Marcel de Rooy
URL:
Keywords:
Depends on: 32939
Blocks: 33289
  Show dependency treegraph
 
Reported: 2023-03-21 07:49 UTC by Jonathan Druart
Modified: 2023-12-28 20:43 UTC (History)
7 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
23.05.00,22.11.05


Attachments
Bug 33290: Fix incorrect variable in http-client.js (2.07 KB, patch)
2023-03-21 08:04 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 33290: Fix incorrect variable in http-client.js (2.12 KB, patch)
2023-03-23 10:10 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 33290: Fix incorrect variable in http-client.js (2.22 KB, patch)
2023-03-24 08:08 UTC, Marcel de Rooy
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Druart 2023-03-21 07:49:13 UTC
Silly error from 
  commit 821808ec31176d662e518418c9ff8a71948e1a4b
  Bug 32939: Use APIClient to replace PATCH requests

+        const body = params.body
+            ? typeof str === "string"
+                ? params.body
+                : JSON.stringify(params.body)
+            : undefined;

  typeof str === "string"
must be
  typeof params.body === "string"
Comment 1 Jonathan Druart 2023-03-21 08:04:46 UTC
Created attachment 148441 [details] [review]
Bug 33290: Fix incorrect variable in http-client.js

Silly error from
  commit 821808ec31176d662e518418c9ff8a71948e1a4b
  Bug 32939: Use APIClient to replace PATCH requests

+        const body = params.body
+            ? typeof str === "string"
+                ? params.body
+                : JSON.stringify(params.body)
+            : undefined;

  typeof str === "string"
must be
  typeof params.body === "string"

Test plan:
With this patch, bug 33289 is not working properly. The body contains
  "pref_var=value"
instead of
  pref_var=value
and the syspref `var` contains `value"`

Sponsored-by: BULAC - http://www.bulac.fr/
Comment 2 Pedro Amorim 2023-03-23 10:10:33 UTC
Created attachment 148595 [details] [review]
Bug 33290: Fix incorrect variable in http-client.js

Silly error from
  commit 821808ec31176d662e518418c9ff8a71948e1a4b
  Bug 32939: Use APIClient to replace PATCH requests

+        const body = params.body
+            ? typeof str === "string"
+                ? params.body
+                : JSON.stringify(params.body)
+            : undefined;

  typeof str === "string"
must be
  typeof params.body === "string"

Test plan:
With this patch, bug 33289 is not working properly. The body contains
  "pref_var=value"
instead of
  pref_var=value
and the syspref `var` contains `value"`

Sponsored-by: BULAC - http://www.bulac.fr/
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Comment 3 Marcel de Rooy 2023-03-24 08:08:01 UTC
Created attachment 148630 [details] [review]
Bug 33290: Fix incorrect variable in http-client.js

Silly error from
  commit 821808ec31176d662e518418c9ff8a71948e1a4b
  Bug 32939: Use APIClient to replace PATCH requests

+        const body = params.body
+            ? typeof str === "string"
+                ? params.body
+                : JSON.stringify(params.body)
+            : undefined;

  typeof str === "string"
must be
  typeof params.body === "string"

Test plan:
With this patch, bug 33289 is not working properly. The body contains
  "pref_var=value"
instead of
  pref_var=value
and the syspref `var` contains `value"`

Sponsored-by: BULAC - http://www.bulac.fr/
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 4 Tomás Cohen Arazi 2023-03-27 09:43:50 UTC
Pushed to master for 23.05.

Nice work everyone, thanks!
Comment 5 Matt Blenkinsop 2023-04-11 08:48:24 UTC
Nice work everyone!

Pushed to stable for 22.11.x
Comment 6 Katrin Fischer 2023-04-11 09:05:17 UTC
(In reply to Matt Blenkinsop from comment #5)
> Nice work everyone!
> 
> Pushed to stable for 22.11.x

Hi Matt, should it be 22.11.05 in the "Version(s) released in"?
Comment 7 Lucas Gass 2023-04-24 16:55:28 UTC
Not needed in 22.05.x, no backport