Content
View differences
Updated by Aidas Kasparas over 8 years ago
When external tools need to point users to a list of work packages (to make changes in these packages using OpenProject itself), sometimes the only suitable filter is IDs of these work packages.
**Actual result**
Unfortunately, when ID filter is used, like in https://community.openproject.com/projects/openproject/work\_packages?query\_props=%7B%22f%22:%5B%7B%22n%22:%22id%22,%22o%22:%22%3D%22,%22v%22:%5B25422%5D%7D%5D%7D
UI informs that “Your query is erroneous and could not be processed.” and production.log receives log lines like this.
F, \[2017-10-03T15:22:57.213007 \#12441\] FATAL — :
F, \[2017-10-03T15:22:57.213241 \#12441\] FATAL — : NotImplementedError (There would be too many candidates):
F, \[2017-10-03T15:22:57.213313 \#12441\] FATAL — :
F, \[2017-10-03T15:22:57.213392 \#12441\] FATAL — : app/models/queries/work\_packages/filter/id\_filter.rb:41:in \`value\_objects’
app/models/queries/filters/base.rb:143:in \`value\_objects\_hash’
lib/api/v3/queries/filters/query\_filter\_instance\_representer.rb:80:in \`block in <class:QueryFilterInstanceRepresenter>’
lib/api/root.rb:45:in \`call’
**Required result**
Request like above should produce list of work packages whose IDs are provided in the filter. Maybe their parents work packages included too.
Filter pane should not have full list of all tasks loaded. Should it show ID filter at all is an open question—I’m happy either way.
**Discussion**
Removing Queries::WorkPackages::Filter::IdFilter::value\_objects method allows to filter, but loads all tasks. I still didn’t find a way to prevent that.
If ID filter is shown I think it should be input like where ID can be entered comma/space separated.
**Actual result**
Unfortunately, when ID filter is used, like in https://community.openproject.com/projects/openproject/work\_packages?query\_props=%7B%22f%22:%5B%7B%22n%22:%22id%22,%22o%22:%22%3D%22,%22v%22:%5B25422%5D%7D%5D%7D
UI informs that “Your query is erroneous and could not be processed.” and production.log receives log lines like this.
F, \[2017-10-03T15:22:57.213007 \#12441\] FATAL — :
F, \[2017-10-03T15:22:57.213241 \#12441\] FATAL — : NotImplementedError (There would be too many candidates):
F, \[2017-10-03T15:22:57.213313 \#12441\] FATAL — :
F, \[2017-10-03T15:22:57.213392 \#12441\] FATAL — : app/models/queries/work\_packages/filter/id\_filter.rb:41:in \`value\_objects’
app/models/queries/filters/base.rb:143:in \`value\_objects\_hash’
lib/api/v3/queries/filters/query\_filter\_instance\_representer.rb:80:in \`block in <class:QueryFilterInstanceRepresenter>’
lib/api/root.rb:45:in \`call’
**Required result**
Request like above should produce list of work packages whose IDs are provided in the filter. Maybe their parents work packages included too.
Filter pane should not have full list of all tasks loaded. Should it show ID filter at all is an open question—I’m happy either way.
**Discussion**
Removing Queries::WorkPackages::Filter::IdFilter::value\_objects method allows to filter, but loads all tasks. I still didn’t find a way to prevent that.
If ID filter is shown I think it should be input like where ID can be entered comma/space separated.