Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0025119Openbravo ERPA. Platformpublic2013-11-11 10:412013-11-19 19:07
caristu 
alostale 
immediatemajoralways
closedfixed 
5
pi 
3.0MP303.0MP30 
shankarb
Core
Production - QA Approved
2013-04-09
https://code.openbravo.com/erp/devel/pi/rev/f497677fd0d9 [^]
No
0025119: Problem with grid configuration and field grouping
When the grid configuration of a window is saved including a field grouping (http://wiki.openbravo.com/wiki/User_Interface_Introduction#Grouping [^]), then is not possible to access the window.

The following error appears in the javascript console when accessing the window: "Uncaught TypeError: Cannot call method 'slice' of null"
As system administrator
1) Go to the [Preference] window and create a new record:
   - Property: Grouping Enabled
   - Value: Y
As group admin
2) Go to any window, for example [Sales Invoice]
3) Right-click on any column, and click on the Group by... option
4) Close the window
5) Open the window again
No tags attached.
related to defect 0024684 closed alostale Double DataSource request when there is grid configuration 
Issue History
2013-11-11 10:41caristuNew Issue
2013-11-11 10:41caristuAssigned To => AugustoMauch
2013-11-11 10:41caristuModules => Core
2013-11-11 10:41caristuTriggers an Emergency Pack => No
2013-11-11 10:42caristuIssue Monitored: networkb
2013-11-11 10:49AugustoMauchAssigned ToAugustoMauch => shankarb
2013-11-11 15:58caristuRegression introduced by commit => https://code.openbravo.com/erp/devel/pi/rev/f497677fd0d9 [^]
2013-11-11 15:58caristuPriorityhigh => immediate
2013-11-11 15:58caristuSeverityminor => major
2013-11-15 06:27priyamIssue Monitored: priyam
2013-11-15 09:13alostaleNote Added: 0062136
2013-11-15 09:13alostaleRelationship addedrelated to 0024684
2013-11-15 09:22alostaleNote Added: 0062137
2013-11-15 09:22alostaleNote Edited: 0062136bug_revision_view_page.php?bugnote_id=0062136#r5194
2013-11-15 09:23alostaleRegression level => Production - QA Approved
2013-11-15 09:23alostaleRegression date => 2013-04-09
2013-11-15 09:24alostaleReview Assigned To => alostale
2013-11-15 09:30alostaleAssigned Toshankarb => alostale
2013-11-15 09:31alostaleNote Added: 0062138
2013-11-15 09:33alostaleReview Assigned Toalostale => shankarb
2013-11-15 09:49hgbotCheckin
2013-11-15 09:49hgbotNote Added: 0062139
2013-11-15 09:49hgbotStatusnew => resolved
2013-11-15 09:49hgbotResolutionopen => fixed
2013-11-15 09:49hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/73efa41903ad82eac87aac7ef881adc280c39cf9 [^]
2013-11-15 09:55alostaleNote Added: 0062140
2013-11-15 09:55alostaleStatusresolved => new
2013-11-15 09:55alostaleResolutionfixed => open
2013-11-15 10:46alostaleNote Edited: 0062140bug_revision_view_page.php?bugnote_id=0062140#r5196
2013-11-15 10:50alostaleNote Added: 0062141
2013-11-15 10:53hgbotCheckin
2013-11-15 10:53hgbotNote Added: 0062142
2013-11-15 10:53hgbotStatusnew => resolved
2013-11-15 10:53hgbotResolutionopen => fixed
2013-11-15 10:53hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/devel/pi/rev/73efa41903ad82eac87aac7ef881adc280c39cf9 [^] => http://code.openbravo.com/erp/devel/pi/rev/3c17ffad5021da3e83dee712c4ea0388a38e05fa [^]
2013-11-15 15:21alostaleNote Added: 0062151
2013-11-15 15:23hgbotCheckin
2013-11-15 15:23hgbotNote Added: 0062152
2013-11-15 15:23hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/devel/pi/rev/3c17ffad5021da3e83dee712c4ea0388a38e05fa [^] => http://code.openbravo.com/erp/devel/pi/rev/49c475685925ad48c03bf28556a2965ed0066fb0 [^]
2013-11-15 15:50shankarbNote Added: 0062153
2013-11-15 15:50shankarbStatusresolved => closed
2013-11-15 15:50shankarbFixed in Version => 3.0MP30
2013-11-16 22:53johnfandlIssue Monitored: johnfandl
2013-11-19 19:07hudsonbotCheckin
2013-11-19 19:07hudsonbotNote Added: 0062259
2013-11-19 19:07hudsonbotCheckin
2013-11-19 19:07hudsonbotNote Added: 0062260
2013-11-19 19:07hudsonbotCheckin
2013-11-19 19:07hudsonbotNote Added: 0062263

Notes
(0062136)
alostale   
2013-11-15 09:13   
(edited on: 2013-11-15 09:22)
Regression introduced in MP28

When in this situation, a javascript error is thrown by SmartClient's ListGrid.getFrozenSlots method:

Uncaught TypeError: Cannot call method 'slice' of null ListGrid.js:31570
isc.ListGrid.addMethods.getFrozenSlots

doing array.slice because array is null at this point.

The root cause is grid field grouping is done locally in client manipulating data that has been fetched. To fix issue 0024684, saved view is applied before requesting data so in case saved view includes grouping it is tried to be applied to an empty (null) array of data.

(0062137)
alostale   
2013-11-15 09:22   
When this error happens, the window that was tried to be opened remains in loading data not being possible to be operated.

Workaround: delete entries for that window in:
-Window Personalization window
-Preferences window (as System Admin), the ones with Property "Default View Setting" and "Grid Configuration"
(0062138)
alostale   
2013-11-15 09:31   
Executed test cases:

Both at main tab and sub tab levels:
-Do grouping and save view, close and open window, apply saved view
-Set saved view with grouping as default view, close and open window

In all the 4 cases grouping is properly applied
(0062139)
hgbot   
2013-11-15 09:49   
Repository: erp/devel/pi
Changeset: 73efa41903ad82eac87aac7ef881adc280c39cf9
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Fri Nov 15 09:47:05 2013 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/73efa41903ad82eac87aac7ef881adc280c39cf9 [^]

fixed bug 25119: problem with grid configuration and field grouping

  Don't apply grouping grid configuration till dataset callback as grouping is
  done in client side with grid's data it expects data to be present

---
M modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-view-grid.js
M modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-view.js
M modules/org.openbravo.client.application/web/org.openbravo.client.application/js/personalization/ob-manage-views.js
---
(0062140)
alostale   
2013-11-15 09:55   
(edited on: 2013-11-15 10:46)
Reopening: when current grid status contains both filtering and grouping, clicking in funnel icon to remove filters causes a javascript exception

(0062141)
alostale   
2013-11-15 10:50   
In case of current grid status contains both filter clause and grouping and filter is removed, grouping will also be removed. This makes sense because data after removing filter clause can be bigger than the number of rows supported by grouping.

Additional test cases:

-In a window with default filter clause (such as Sales Order). Open the window, without removing filter clause, apply groping by a column. Clean filters, grouping is now removed and complete data is requested.
-In a window without default filter clause. Apply grouping and filter, remove filter. Grouping is preserved.
(0062142)
hgbot   
2013-11-15 10:53   
Repository: erp/devel/pi
Changeset: 3c17ffad5021da3e83dee712c4ea0388a38e05fa
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Fri Nov 15 10:52:43 2013 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/3c17ffad5021da3e83dee712c4ea0388a38e05fa [^]

fixed bug 25119: problem with grid configuration and field grouping

  Remove grouping when deleting filters in case of filter clause

---
M modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-grid.js
---
(0062151)
alostale   
2013-11-15 15:21   
Previous fix still doesn't work for the case of not using saved views, but just adding a group, closing the window and opening it again. In this case, it doesn't fail, but the grouping is not applied.

Additionally tested after new patch: explained case both at root tab and sub tabs.
(0062152)
hgbot   
2013-11-15 15:23   
Repository: erp/devel/pi
Changeset: 49c475685925ad48c03bf28556a2965ed0066fb0
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Fri Nov 15 15:22:59 2013 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/49c475685925ad48c03bf28556a2965ed0066fb0 [^]

fixed bug 25119: Problem with grid configuration and field grouping

  Apply grouping not only for saved views but also in grid configuration

---
M modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-view-grid.js
M modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-window.js
M modules/org.openbravo.client.application/web/org.openbravo.client.application/js/personalization/ob-manage-views.js
---
(0062153)
shankarb   
2013-11-15 15:50   
Code reviewed and verified in pi changeset 49c475685925.
(0062259)
hudsonbot   
2013-11-19 19:07   
A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/ab71e0273dc1 [^]

Maturity status: Test
(0062260)
hudsonbot   
2013-11-19 19:07   
A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/ab71e0273dc1 [^]

Maturity status: Test
(0062263)
hudsonbot   
2013-11-19 19:07   
A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/ab71e0273dc1 [^]

Maturity status: Test