https://www.redmine.org/https://www.redmine.org/favicon.ico?16793021292019-08-19T15:18:22ZRedmineRedmine - Defect #31924: Paging misses some entrieshttps://www.redmine.org/issues/31924?journal_id=932332019-08-19T15:18:22ZAttie Grande
<ul></ul><p>Gah, not markdown and I can't edit the original...</p>
<p>Also the example code was broken:</p>
<pre>
import json
import itertools
import requests
base_url = 'https://redmine.example.com'
headers = {
'X-Redmine-API-Key': 'YOUR_API_KEY'
}
params = {
'limit': 5
}
count = 0
entries = {}
for i in itertools.count(0, params['limit']):
params['offset'] = i
response = requests.get(f'{base_url}/time_entries.json', params=params, headers=headers)
content = json.loads(response.content)
num = len(content['time_entries'])
count += num
for e in content['time_entries']:
e_id = e['id']
print(e_id)
if e_id in entries:
raise Exception(f'ID {e_id} already exists!')
entries[e_id] = e
if content['offset'] + num >= content['total_count']:
break
print(count)
print(len(entries))
</pre> Redmine - Defect #31924: Paging misses some entrieshttps://www.redmine.org/issues/31924?journal_id=932442019-08-20T02:48:17ZGo MAEDA
<ul><li><strong>Status</strong> changed from <i>New</i> to <i>Needs feedback</i></li></ul><p>Could you try the following patch extracted from <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Defect: Issues in paginated views may be lost because sorting criteria are not unique (Closed)" href="https://www.redmine.org/issues/29581">#29581</a>?</p>
<pre><code class="diff syntaxhl"><span class="gh">Index: app/models/time_entry_query.rb
===================================================================
</span><span class="gd">--- app/models/time_entry_query.rb (revision 18379)
</span><span class="gi">+++ app/models/time_entry_query.rb (working copy)
</span><span class="p">@@ -141,6 +141,7 @@</span>
def results_scope(options={})
order_option = [group_by_sort_order, (options[:order] || sort_clause)].flatten.reject(&:blank?)
+ order_option << "#{TimeEntry.table_name}.id ASC"
base_scope.
order(order_option).
joins(joins_for_order_statement(order_option.join(',')))
</code></pre> Redmine - Defect #31924: Paging misses some entrieshttps://www.redmine.org/issues/31924?journal_id=933982019-08-30T11:27:17ZAttie Grande
<ul></ul><p>Hi,</p>
<p>Thanks for your reply, and sorry for my delay (it looks like your emails are going into spam by the way - you're getting SPF neutral).</p>
<p>I applied the full fix-29581-v3.patch, and it's resolved the issue for me - thanks very much!</p>
<p>Any idea when this patch will make it into a release? It looks like it's scheduled for v4.1.0?<br />I've incorporated it into my docker image for the moment.</p>
<p>Feel free to close this ticket as a duplicate.</p>
<p>Attie</p> Redmine - Defect #31924: Paging misses some entrieshttps://www.redmine.org/issues/31924?journal_id=933992019-08-30T13:46:27ZGo MAEDA
<ul><li><strong>Is duplicate of</strong> <i><a class="issue tracker-1 status-5 priority-4 priority-default closed" href="/issues/29581">Defect #29581</a>: Issues in paginated views may be lost because sorting criteria are not unique</i> added</li></ul> Redmine - Defect #31924: Paging misses some entrieshttps://www.redmine.org/issues/31924?journal_id=934012019-08-30T13:49:36ZGo MAEDA
<ul><li><strong>Status</strong> changed from <i>Needs feedback</i> to <i>Closed</i></li><li><strong>Resolution</strong> set to <i>Duplicate</i></li></ul><p>Thank you for your feedback. I am happy to hear that the problem was fixed by the patch.</p>
<p>I think that Redmine 4.1.0 should be released soon, but I don't know the accurate date.</p>