-
-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[fc] Repository: plone.app.querystring
Branch: refs/heads/master Date: 2020-07-14T15:46:31+02:00 Author: Georg Gogo. BERNHARD (gogobd) <gogo@bluedynamics.com> Commit: plone/plone.app.querystring@6ba125e Issue #97 i.e. allow for MultiPath Queries (#98) Changes for bugfix #97 - making PATH_INDICES dynamic Files changed: A news/97.bugfix M plone/app/querystring/queryparser.py
- Loading branch information
Showing
1 changed file
with
10 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,18 @@ | ||
Repository: plone.formwidget.namedfile | ||
Repository: plone.app.querystring | ||
|
||
|
||
Branch: refs/heads/master | ||
Date: 2020-07-14T10:02:05+02:00 | ||
Author: Vincent Fretin (vincentfretin) <vincent.fretin@gmail.com> | ||
Commit: https://github.com/plone/plone.formwidget.namedfile/commit/1189d0e0349bb5251a26491b4bd6feb096f84a3c | ||
Date: 2020-07-14T15:46:31+02:00 | ||
Author: Georg Gogo. BERNHARD (gogobd) <gogo@bluedynamics.com> | ||
Commit: https://github.com/plone/plone.app.querystring/commit/6ba125e57eb1b571352325038fcda9f1f3b765fd | ||
|
||
fix syntax error in changelog | ||
Issue #97 i.e. allow for MultiPath Queries (#98) | ||
|
||
Changes for bugfix #97 - making PATH_INDICES dynamic | ||
|
||
Files changed: | ||
M CHANGES.rst | ||
A news/97.bugfix | ||
M plone/app/querystring/queryparser.py | ||
|
||
b'diff --git a/CHANGES.rst b/CHANGES.rst\nindex cf5f0cc..cb753c1 100644\n--- a/CHANGES.rst\n+++ b/CHANGES.rst\n@@ -14,8 +14,8 @@ Changelog\n New features:\n \n \n-- - Range support (https://developer.mozilla.org/en-US/docs/Web/HTTP/Range_requests)\n- [mamico] (#44)\n+- Range support (https://developer.mozilla.org/en-US/docs/Web/HTTP/Range_requests)\n+ [mamico] (#44)\n \n \n 2.0.11 (2020-04-20)\n' | ||
b'diff --git a/news/97.bugfix b/news/97.bugfix\nnew file mode 100644\nindex 0000000..955f8f5\n--- /dev/null\n+++ b/news/97.bugfix\n@@ -0,0 +1 @@\n+Fixing issue #97: Multiple path support for Translation Groups, using PATH_INDICES as suggested by jensens\ndiff --git a/plone/app/querystring/queryparser.py b/plone/app/querystring/queryparser.py\nindex 1f28824..55124d7 100644\n--- a/plone/app/querystring/queryparser.py\n+++ b/plone/app/querystring/queryparser.py\n@@ -14,6 +14,7 @@\n \n \n Row = namedtuple(\'Row\', [\'index\', \'operator\', \'values\'])\n+PATH_INDICES = {\'path\'}\n \n \n def parseFormquery(context, formquery, sort_on=None, sort_order=None):\n@@ -41,8 +42,15 @@ def parseFormquery(context, formquery, sort_on=None, sort_order=None):\n kwargs = parser(context, row)\n \n # Special path handling - since multipath queries are possible\n- if \'path\' in query and \'path\' in kwargs:\n- query[\'path\'][\'query\'].extend(kwargs[\'path\'][\'query\'])\n+ path_index = PATH_INDICES & set(kwargs)\n+ if len(path_index) == 1:\n+ path_index = list(path_index)[0]\n+ if path_index in query:\n+ query[path_index][\'query\'].extend(kwargs[path_index][\'query\'])\n+ else:\n+ query.update(kwargs)\n+ elif len(path_index) > 1:\n+ raise IndexError("Too many path indices in one row.")\n else:\n query.update(kwargs)\n \n' | ||
|