Project

General

Profile

Actions

Defect #31972

closed

An empty group_count badge is displayed when grouped with created_on

Added by Mizuki ISHIKAWA over 6 years ago. Updated 10 days ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Issues list
Target version:
Resolution:
Fixed
Affected version:

Description

Reproduction procedure
  • Use MySQL
  • Time zone data is not loaded
  • Change user language from UTC to something else
  • Group by created_on at issues/index

When the above conditions are met, the group_count badge will be displayed as empty as shown in the screenshot.

It doesn't matter if group_count is nil because MySQL doesn't get group_count if it doesn't load time zone data.
The problem is that an empty badge is displayed at that time.

Badge should also be hidden if group_count is not successfully acquired(like timelog).

This is a problem with trunk.


Files

ScreenShot-2019-08-29-10.49.27.png (82.2 KB) ScreenShot-2019-08-29-10.49.27.png Mizuki ISHIKAWA, 2019-08-29 04:08
fix-31972.patch (973 Bytes) fix-31972.patch Mizuki ISHIKAWA, 2019-09-11 02:48
31972-r24407.patch (999 Bytes) 31972-r24407.patch Go MAEDA, 2026-02-15 14:50
Actions #1

Updated by Mizuki ISHIKAWA over 6 years ago

I forgot to attach the patch.
Change the same as timelog .

Actions #2

Updated by Go MAEDA 17 days ago

I have updated the patch for the current trunk.
Setting the target version to 6.0.9.

Actions #3

Updated by Go MAEDA 14 days ago

  • Status changed from New to Resolved
  • Assignee set to Go MAEDA
  • Resolution set to Fixed

Committed the fix in r24424. Thank you.

Actions #4

Updated by Go MAEDA 13 days ago

  • Status changed from Resolved to Closed

Merged the fix into the stable branches in r24430 and r24431.

Actions #5

Updated by Marius BĂLTEANU 13 days ago

  • Status changed from Closed to Reopened

We should add a test:

  def test_index_with_group_by_and_nil_group_count_should_not_render_empty_badge
    Issue.generate!(:created_on => '2019-08-29 10:00:00')

    IssueQuery.any_instance.stubs(:result_count_by_group).returns(nil)

    get(
      :index,
      :params => {
        :set_filter => 1,
        :group_by => 'created_on'
      }
    )
    assert_response :success

    assert_select 'tr.group' do
      assert_select 'span.name'
      assert_select 'span.badge-count.count', 0
    end
  end
Actions #6

Updated by Marius BĂLTEANU 10 days ago

  • Status changed from Reopened to Closed

I've committed and merged the test.

Actions

Also available in: Atom PDF