Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0042270Openbravo ERPA. Platformpublic2019-11-13 18:282019-12-12 23:01
caristu 
caristu 
highminorhave not tried
closedfixed 
5
 
3.0PR20Q1 
alostale
Core
No
0042270: Grid not properly initialized due to missing window personalization information
The grids of an standard window can not be initialized properly having view personalizations: if the default view personalization is not provided by the WindowSettingsActionHandler and there exists one or more view personalizations then the following JS error is thrown when trying to save a record:

Class.js:1796 Uncaught TypeError: Cannot read property 'length' of undefined
    at cons.addToCacheData (b695962a877b1a59ae4c48580e07e5f7.js:47135)
    at cons.callback [as _userCallback] (b695962a877b1a59ae4c48580e07e5f7.js:42783)
    at cons.fireCallback (Class.js:1789)
    at cons.fireCallback (Class.js:3488)
    at cons.formSavedComplete (ActionMethods.js:1132)
    at cons._saveDataReply (ActionMethods.js:1102)
    at cons.eval (eval at isc__makeFunction (Object.js:129), <anonymous>:1:18)
    at cons.fireCallback (Class.js:1789)
    at cons.fireCallback (Class.js:3488)
    at cons.fireResponseCallbacks (DataSource.js:13641)
1) Go to the [Purchase Order] window and create a new saved view. Set it as default.
2) Go to the database and perform a manual delete of the window personalization created in step 1: delete from obuiapp_uipersonalization where obuiapp_uipersonalization_id =<uuid>. This lead us to an state where the default save view is still defined in the application (through the "Default View Setting" preference) but the window personalization definition is not present.
3) Log out/log in
4) Go to the [Purchase Order] window and create a new saved view. Do NOT set it as default.
5) Log out/log in
6) Go to the [Purchase Order] and try to create a new record. The JS error is thrown which avoids to save the record.
No tags attached.
related to defect 00282423.0PR15Q1 closed AugustoMauch First request to load the window data is not done under some circumnstances 
Issue History
2019-11-13 18:28caristuNew Issue
2019-11-13 18:28caristuAssigned To => platform
2019-11-13 18:28caristuModules => Core
2019-11-13 18:28caristuTriggers an Emergency Pack => No
2019-11-13 18:28caristuRelationship addedrelated to 0028242
2019-11-13 18:34caristuAssigned Toplatform => caristu
2019-11-13 18:36caristuReview Assigned To => alostale
2019-11-13 19:30hgbotCheckin
2019-11-13 19:30hgbotNote Added: 0115591
2019-11-13 19:30hgbotStatusnew => resolved
2019-11-13 19:30hgbotResolutionopen => fixed
2019-11-13 19:30hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/0a493e062362c9d16b14311e5c0ede6228f95308 [^]
2019-11-13 19:31caristuSummaryWindow generated in inconsistent state due to missing window personalization information => Window grids not properly initialized due to missing window personalization information
2019-11-13 19:31caristuDescription Updatedbug_revision_view_page.php?rev_id=19692#r19692
2019-11-13 19:31caristuSummaryWindow grids not properly initialized due to missing window personalization information => grid not properly initialized due to missing window personalization information
2019-11-13 19:32caristuSummarygrid not properly initialized due to missing window personalization information => Grid not properly initialized due to missing window personalization information
2019-11-13 19:32caristuDescription Updatedbug_revision_view_page.php?rev_id=19693#r19693
2019-11-14 08:36rafarodaIssue Monitored: rafaroda
2019-11-15 09:21alostaleStatusresolved => closed
2019-11-15 09:21alostaleFixed in Version => 3.0PR20Q1
2019-11-15 09:21alostaleNote Added: 0115618
2019-12-12 23:01hudsonbotCheckin
2019-12-12 23:01hudsonbotNote Added: 0116283

Notes
(0115591)
hgbot   
2019-11-13 19:30   
Repository: erp/devel/pi
Changeset: 0a493e062362c9d16b14311e5c0ede6228f95308
Author: Carlos Aristu <carlos.aristu <at> openbravo.com>
Date: Wed Nov 13 19:14:34 2019 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/0a493e062362c9d16b14311e5c0ede6228f95308 [^]

fixes bug 42270: window can be not initialized if default saved view is missing

  Having a window with several saved view personalizations, if the default saved view is not provided by the WindowSettingsActionHandler then the header's grid was not properly initialized, leaving it in an inconsistent state which did not allow to save records.

  Note that it already exists a mechanism that tries to avoid this scenario by deleting the configuration used to mark a personalization as default in case it does not exists (WindowPersonalizationEventHandler). But this inconsistent state can be also reached in case the window personalization is manually deleted through the database (i.e., by deleting the corresponding obuiapp_uipersonalization record).

  To fix this problem now we are forcing the grid initialization in case the default view is not found.

---
M modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-window.js
---
(0115618)
alostale   
2019-11-15 09:21   
reviewed + tested
(0116283)
hudsonbot   
2019-12-12 23:01   
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/954d2b7a66fb [^]
Maturity status: Test