[Koha-bugs] [Bug 30165] Several q parameters break the filters

2022-12-05 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30165

David Cook  changed:

   What|Removed |Added

 Blocks||32406


Referenced Bugs:

https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32406
[Bug 32406] Cannot search pending orders using non-latin-1 scripts
-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 30165] Several q parameters break the filters

2022-05-04 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30165

Andrew Nugged  changed:

   What|Removed |Added

 Blocks||30677


Referenced Bugs:

https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30677
[Bug 30677] Unknown column 'biblioitem.title' in 'where clause' 500 error in
API /api/v1/acquisitions/orders
-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 30165] Several q parameters break the filters

2022-05-04 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30165

Andrew Nugged  changed:

   What|Removed |Added

 Blocks|30677   |

--- Comment #30 from Andrew Nugged  ---
Adding solution: Bug 30677


Referenced Bugs:

https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30677
[Bug 30677] Unknown column 'biblioitem.title' in 'where clause' 500 error in
API /api/v1/acquisitions/orders
-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 30165] Several q parameters break the filters

2022-05-04 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30165

Andrew Nugged  changed:

   What|Removed |Added

 Blocks||30677


Referenced Bugs:

https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30677
[Bug 30677] Unknown column 'biblioitem.title' in 'where clause' 500 error in
API /api/v1/acquisitions/orders
-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 30165] Several q parameters break the filters

2022-05-04 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30165

--- Comment #29 from Andrew Nugged  ---
(also I think it might not need "m//" but just "s///" if it has that lookahead)

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 30165] Several q parameters break the filters

2022-05-04 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30165

Andrew Nugged  changed:

   What|Removed |Added

 CC||nug...@gmail.com

--- Comment #28 from Andrew Nugged  ---
Seems this is the source of exception:

[ERROR] GET /api/v1/acquisitions/orders: unhandled exception
(DBIx::Class::Exception)<
'{"-and":[{"basket.vendor_id":2},[[{"basket.name":{"like":"%f%"}}],[{"basket.basket_group.name":{"like":"%f%"}}],[{"me.order_id":{"like":"%f%"}}],[{"biblio.title":{"like":"%f%"}},{"biblio.author":{"like":"%f%"}},{"biblio.isbn":{"like":"%f%"}},{"biblio.publisher":{"like":"%f%"}},{"me.internal_note":{"like":"%f%"}},{"me.vendor_note":{"like":"%f%"}}],[{"me.replacement_price":{"like":"%f%"}}],[{"me.quantity":{"like":"%f%"}}],[{"me.ecost":{"like":"%f%"}}],[{"fund.name":{"like":"%f%"}}]]]}'
};

out:

  'q' =>
'{"-and":[{"basket.vendor_id":2},[[{"basket.name":{"like":"%f%"}}],[{"basket.basket_group.name":{"like":"%f%"}}],[{"me.order_id":{"like":"%f%"}}],[{"biblio.biblioitem.title":{"like":"%f%"}},{"biblio.biblioitem.author":{"like":"%f%"}},{"biblio.biblioitem.isbn":{"like":"%f%"}},{"biblio.biblioitem.publisher":{"like":"%f%"}},{"me.internal_note":{"like":"%f%"}},{"me.vendor_note":{"like":"%f%"}}],[{"me.replacement_price":{"like":"%f%"}}],[{"me.quantity":{"like":"%f%"}}],[{"me.ecost":{"like":"%f%"}}],[{"fund.name":{"like":"%f%"}}]]]}'
};


That because this:

$q =~ s|biblio\.|biblio\.biblioitem\.|g
  if $q =~ m/.*(isbn|ean|publisher).*/;

should be with lookahead to exclude false matches:

$q =~ s{biblio\.(?=isbn|ean|publisher)}{biblio\.biblioitem\.}g
  if $q =~ m/.*(isbn|ean|publisher).*/;

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 30165] Several q parameters break the filters

2022-03-25 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30165

Kyle M Hall  changed:

   What|Removed |Added

 Status|Pushed to master|Pushed to stable
 Version(s)|22.05.00|22.05.00,21.11.05
released in||

--- Comment #27 from Kyle M Hall  ---
Pushed to 21.11.x for 21.11.05

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 30165] Several q parameters break the filters

2022-03-25 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30165

Fridolin Somers  changed:

   What|Removed |Added

   Keywords|additional_work_needed  |

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 30165] Several q parameters break the filters

2022-03-25 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30165

Fridolin Somers  changed:

   What|Removed |Added

 Attachment #132138|0   |1
is obsolete||

--- Comment #26 from Fridolin Somers  ---
Comment on attachment 132138
  --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=132138
[OPTION 1] Bug 30165: (follow-up) Address OpenAPI vs. no-OpenAPI in the tests

Lets go for option 2.

> Bug 30165: (follow-up) Allow objects.search usage outside OpenAPI
Pushed to master

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 30165] Several q parameters break the filters

2022-03-24 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30165

--- Comment #25 from Tomás Cohen Arazi  ---
(In reply to Fridolin Somers from comment #24)
> I'd say option 2.
> This may be useful in some other usages of Objects.search

I agree.

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 30165] Several q parameters break the filters

2022-03-24 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30165

--- Comment #24 from Fridolin Somers  ---
I'd say option 2.
This may be useful in some other usages of Objects.search

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 30165] Several q parameters break the filters

2022-03-24 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30165

--- Comment #23 from Tomás Cohen Arazi  ---
Created attachment 132139
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=132139=edit
[OPTION 2] Bug 30165: (follow-up) Allow objects.search usage outside OpenAPI

Our objects.search helper is written for being used in our API
controllers, which get their query parameters processed by the OpenAPI
plugin, using JSON::Validator.

Particularly, the 'q' parameter is defined as 'multi' on our spec, which
means objects.search always gets it as an arrayref.

As the Objects.t tests are not using the OpenAPI plugin, a hashref is
generated as only one q= is being passed. This patch adds an extra
validation on objects.search, for the non-arrayref use case and does the
right thing.

To test:
1. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/REST/Plugin/Objects.t
=> FAIL: Tests fail!
2. Apply this patch
3. Repeat 1
=> SUCCESS: Tests pass!
4. Sign off :-D

Signed-off-by: Tomas Cohen Arazi 

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 30165] Several q parameters break the filters

2022-03-24 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30165

--- Comment #22 from Tomás Cohen Arazi  ---
Created attachment 132138
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=132138=edit
[OPTION 1] Bug 30165: (follow-up) Address OpenAPI vs. no-OpenAPI in the tests

Our objects.search helper is written for being used in our API
controllers, which get their query parameters processed by the OpenAPI
plugin, using JSON::Validator.

Particularly, the 'q' parameter is defined as 'multi' on our spec, which
means objects.search always gets it as an arrayref.

As the Objects.t tests are not using the OpenAPI plugin, a hashref is
generated as only one q= is being passed. This patch adds an extra
(empty) q param to the tests to overcome this.

To test:
1. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/REST/Plugin/Objects.t
=> FAIL: Tests fail!
2. Apply this patch
3. Repeat 1
=> SUCCESS: Tests pass!
4. Sign off :-D

Signed-off-by: Tomas Cohen Arazi 

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 30165] Several q parameters break the filters

2022-03-22 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30165

Fridolin Somers  changed:

   What|Removed |Added

   Keywords||additional_work_needed
 CC||fridolin.som...@biblibre.co
   ||m

--- Comment #21 from Fridolin Somers  ---
This breaks t/db_dependent/Koha/REST/Plugin/Objects.t

See
https://jenkins.koha-community.org/view/master/job/Koha_Master_D10/556/testReport/

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 30165] Several q parameters break the filters

2022-03-22 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30165

--- Comment #20 from Fridolin Somers  ---
Pushed to master for 22.05, thanks to everybody involved 濾

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 30165] Several q parameters break the filters

2022-03-22 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30165

Fridolin Somers  changed:

   What|Removed |Added

 Version(s)||22.05.00
released in||
 Status|Passed QA   |Pushed to master

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 30165] Several q parameters break the filters

2022-03-17 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30165

--- Comment #19 from Jonathan Druart  ---
That's awesome, thanks!

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 30165] Several q parameters break the filters

2022-03-17 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30165

--- Comment #18 from Jonathan Druart  ---
Created attachment 131823
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=131823=edit
Bug 30165: (follow-up) Fix GET /acquisitions/orders

This patch fixes the particular use case of the orders route, which has
a slightly modified version of the objects.search helped, embeded in the
controller itself. This controller gets adjusted to the fact q will now
be an array.

Because of the latter, we end up requiring more code duplication
regarding the query fix, so I moved it to an internal sub that gets
reused.

To test:
1. Apply the previous patches
2. Run:
   $ kshell
  k$ prove t/db_dependent/api/v1/*
=> FAIL: It t/db_dependent/api/v1/acquisitions_orders.t fails!
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass!
5. Sign off :-D

Signed-off-by: Tomas Cohen Arazi 
Signed-off-by: Martin Renvoize 

Signed-off-by: Jonathan Druart 

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 30165] Several q parameters break the filters

2022-03-17 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30165

--- Comment #17 from Jonathan Druart  ---
Created attachment 131822
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=131822=edit
Bug 30165: Make q parameter 'multi'

This patch changes the q_param definition so the defined query parameter
is repeatable. This way JSON::Validator will always generate an arrayref
for it and won't skip occurences.

The objects.search helper is updated to always consider the 'q'
parameter as an array, as expected.

To test:
1. Apply the regression tests patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/api/v1/query.t
=> FAIL: Tests fail!
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass!
5. Sign off :-D

Signed-off-by: Tomas Cohen Arazi 
Signed-off-by: Martin Renvoize 

Signed-off-by: Jonathan Druart 

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 30165] Several q parameters break the filters

2022-03-17 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30165

Jonathan Druart  changed:

   What|Removed |Added

 Attachment #131803|0   |1
is obsolete||
 Attachment #131804|0   |1
is obsolete||
 Attachment #131805|0   |1
is obsolete||

--- Comment #16 from Jonathan Druart  ---
Created attachment 131821
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=131821=edit
Bug 30165: Regression tests

Signed-off-by: Martin Renvoize 

Signed-off-by: Jonathan Druart 

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 30165] Several q parameters break the filters

2022-03-17 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30165

Jonathan Druart  changed:

   What|Removed |Added

 Status|Signed Off  |Passed QA

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 30165] Several q parameters break the filters

2022-03-17 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30165

--- Comment #15 from Jonathan Druart  ---
-# FIXME The following lines are an ugly fix to deal with isbn and
ean searches
-# This must NOT be reused or extended
-# Instead we need a better and global solution in a Koha::*Biblio
method


+The Koha::Biblio representation includes the biblioitem.* attributes. This is
handy
+for API consumers but as they are different tables, converting the queries
that mention
+biblioitem columns can be tricky. This method renames known column names as
used on Koha's
+UI.

Well, that's not equivalent :D

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 30165] Several q parameters break the filters

2022-03-16 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30165

--- Comment #14 from Tomás Cohen Arazi  ---
(In reply to Martin Renvoize from comment #13)
> All seems to work in testing and unit tests are passing.  Signing off

Thanks. The most ugly bit is the changes in the /acquisitions/orders
controller. I will try to make something more generic so we don't need to patch
that separatedly each time.

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 30165] Several q parameters break the filters

2022-03-16 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30165

Martin Renvoize  changed:

   What|Removed |Added

 Status|Needs Signoff   |Signed Off

--- Comment #13 from Martin Renvoize  ---
All seems to work in testing and unit tests are passing.  Signing off

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 30165] Several q parameters break the filters

2022-03-16 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30165

Martin Renvoize  changed:

   What|Removed |Added

 Attachment #131761|0   |1
is obsolete||

--- Comment #12 from Martin Renvoize  ---
Created attachment 131805
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=131805=edit
Bug 30165: (follow-up) Fix GET /acquisitions/orders

This patch fixes the particular use case of the orders route, which has
a slightly modified version of the objects.search helped, embeded in the
controller itself. This controller gets adjusted to the fact q will now
be an array.

Because of the latter, we end up requiring more code duplication
regarding the query fix, so I moved it to an internal sub that gets
reused.

To test:
1. Apply the previous patches
2. Run:
   $ kshell
  k$ prove t/db_dependent/api/v1/*
=> FAIL: It t/db_dependent/api/v1/acquisitions_orders.t fails!
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass!
5. Sign off :-D

Signed-off-by: Tomas Cohen Arazi 
Signed-off-by: Martin Renvoize 

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 30165] Several q parameters break the filters

2022-03-16 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30165

Martin Renvoize  changed:

   What|Removed |Added

 Attachment #131760|0   |1
is obsolete||

--- Comment #11 from Martin Renvoize  ---
Created attachment 131804
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=131804=edit
Bug 30165: Make q parameter 'multi'

This patch changes the q_param definition so the defined query parameter
is repeatable. This way JSON::Validator will always generate an arrayref
for it and won't skip occurences.

The objects.search helper is updated to always consider the 'q'
parameter as an array, as expected.

To test:
1. Apply the regression tests patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/api/v1/query.t
=> FAIL: Tests fail!
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass!
5. Sign off :-D

Signed-off-by: Tomas Cohen Arazi 
Signed-off-by: Martin Renvoize 

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 30165] Several q parameters break the filters

2022-03-16 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30165

Martin Renvoize  changed:

   What|Removed |Added

 Attachment #131759|0   |1
is obsolete||

--- Comment #10 from Martin Renvoize  ---
Created attachment 131803
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=131803=edit
Bug 30165: Regression tests

Signed-off-by: Martin Renvoize 

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 30165] Several q parameters break the filters

2022-03-15 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30165

Jonathan Druart  changed:

   What|Removed |Added

 QA Contact||jonathan.druart+koha@gmail.
   ||com

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 30165] Several q parameters break the filters

2022-03-15 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30165

Tomás Cohen Arazi  changed:

   What|Removed |Added

 CC||n...@bywatersolutions.com

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 30165] Several q parameters break the filters

2022-03-15 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30165

--- Comment #9 from Tomás Cohen Arazi  ---
Created attachment 131761
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=131761=edit
Bug 30165: (follow-up) Fix GET /acquisitions/orders

This patch fixes the particular use case of the orders route, which has
a slightly modified version of the objects.search helped, embeded in the
controller itself. This controller gets adjusted to the fact q will now
be an array.

Because of the latter, we end up requiring more code duplication
regarding the query fix, so I moved it to an internal sub that gets
reused.

To test:
1. Apply the previous patches
2. Run:
   $ kshell
  k$ prove t/db_dependent/api/v1/*
=> FAIL: It t/db_dependent/api/v1/acquisitions_orders.t fails!
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass!
5. Sign off :-D

Signed-off-by: Tomas Cohen Arazi 

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 30165] Several q parameters break the filters

2022-03-15 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30165

--- Comment #8 from Tomás Cohen Arazi  ---
Created attachment 131760
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=131760=edit
Bug 30165: Make q parameter 'multi'

This patch changes the q_param definition so the defined query parameter
is repeatable. This way JSON::Validator will always generate an arrayref
for it and won't skip occurences.

The objects.search helper is updated to always consider the 'q'
parameter as an array, as expected.

To test:
1. Apply the regression tests patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/api/v1/query.t
=> FAIL: Tests fail!
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass!
5. Sign off :-D

Signed-off-by: Tomas Cohen Arazi 

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 30165] Several q parameters break the filters

2022-03-15 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30165

--- Comment #7 from Tomás Cohen Arazi  ---
Created attachment 131759
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=131759=edit
Bug 30165: Regression tests

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 30165] Several q parameters break the filters

2022-03-15 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30165

--- Comment #6 from Tomás Cohen Arazi  ---
(In reply to Tomás Cohen Arazi from comment #5)
> (In reply to Jonathan Druart from comment #4)
> > Does this need to depend on bug 30194?
> 
> My branch had it because there are several collectionFormat handling fixes
> in newer JSON::Validator. But you can try without it. You just need to
> remove the bundle portion.
> 
> My suggestion is to keep the dependency

It works with the older library versions. Removing the dependency so it can be
backported.

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 30165] Several q parameters break the filters

2022-03-15 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30165

Tomás Cohen Arazi  changed:

   What|Removed |Added

 Depends on|30194   |


Referenced Bugs:

https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30194
[Bug 30194] Update required JSON::Validator version
-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 30165] Several q parameters break the filters

2022-03-15 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30165

Tomás Cohen Arazi  changed:

   What|Removed |Added

 Attachment #131707|0   |1
is obsolete||

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 30165] Several q parameters break the filters

2022-03-15 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30165

Tomás Cohen Arazi  changed:

   What|Removed |Added

 Attachment #131706|0   |1
is obsolete||

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 30165] Several q parameters break the filters

2022-03-15 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30165

--- Comment #5 from Tomás Cohen Arazi  ---
(In reply to Jonathan Druart from comment #4)
> Does this need to depend on bug 30194?

My branch had it because there are several collectionFormat handling fixes in
newer JSON::Validator. But you can try without it. You just need to remove the
bundle portion.

My suggestion is to keep the dependency

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 30165] Several q parameters break the filters

2022-03-15 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30165

--- Comment #4 from Jonathan Druart  ---
Does this need to depend on bug 30194?

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 30165] Several q parameters break the filters

2022-03-15 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30165

Tomás Cohen Arazi  changed:

   What|Removed |Added

 Depends on||30194


Referenced Bugs:

https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30194
[Bug 30194] Update required JSON::Validator version
-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 30165] Several q parameters break the filters

2022-03-15 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30165

--- Comment #3 from Tomás Cohen Arazi  ---
Created attachment 131707
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=131707=edit
Bug 30165: Make q parameter 'multi'

This patch changes the q_param definition so the defined query parameter
is repeatable. This way JSON::Validator will always generate an arrayref
for it and won't skip occurences.

The objects.search helper is updated to always consider the 'q'
parameter as an array, as expected.

To test:
1. Apply the regression tests patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/api/v1/query.t
=> FAIL: Tests fail!
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass!
5. Sign off :-D

Signed-off-by: Tomas Cohen Arazi 

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 30165] Several q parameters break the filters

2022-03-15 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30165

--- Comment #2 from Tomás Cohen Arazi  ---
Created attachment 131706
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=131706=edit
Bug 30165: Regression tests

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 30165] Several q parameters break the filters

2022-03-15 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30165

Tomás Cohen Arazi  changed:

   What|Removed |Added

 CC||jonathan.druart+koha@gmail.
   ||com,
   ||k...@bywatersolutions.com

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 30165] Several q parameters break the filters

2022-03-15 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30165

Tomás Cohen Arazi  changed:

   What|Removed |Added

 Attachment #13|0   |1
is obsolete||

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 30165] Several q parameters break the filters

2022-03-15 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30165

Tomás Cohen Arazi  changed:

   What|Removed |Added

 Status|NEW |Needs Signoff
   Patch complexity|--- |Small patch

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 30165] Several q parameters break the filters

2022-02-25 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30165

--- Comment #1 from Tomás Cohen Arazi  ---
Created attachment 13
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=13=edit
Bug 30165: Regression tests

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 30165] Several q parameters break the filters

2022-02-25 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30165

Tomás Cohen Arazi  changed:

   What|Removed |Added

   Assignee|koha-b...@lists.koha-commun |tomasco...@gmail.com
   |ity.org |

-- 
You are receiving this mail because:
You are watching all bug changes.
You are the assignee for the bug.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 30165] Several q parameters break the filters

2022-02-23 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30165

Jonathan Druart  changed:

   What|Removed |Added

 CC||martin.renvoize@ptfs-europe
   ||.com

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/