Article
Incorrect edit page opens when clicking the link from a "Lookup" field.
17:41 Sep 26, 2018
Symptoms
The problem appears when several edit pages are specified for a section that the field refers to. The first edit page opens for any value.
Cause
Incorrect hyperlink as per the field data.
Solution
The problem was fixed in the latest versions of 7.6.0 and starting from 7.7.0. It often happens though, that a customer cannot update to these versions due to different reasons. In this case, we suggest the following solution: create a replacing client module for the BasePageV2 schema and insert the following code therein:
define("BasePageV2", ["terrasoft"], function(Terrasoft) { return { methods: { /** * @inheritdoc Terrasoft.BasePageV2#getEntitySchemaQuery * @overridden */ getEntitySchemaQuery: function() { var esq = this.callParent(arguments); this.Terrasoft.each(this.columns, function(column) { if ((column.type === Terrasoft.ViewModelColumnType.ENTITY_COLUMN) && column.referenceSchemaName) { var referenceSchema = Terrasoft.configuration.EntityStructure[column.referenceSchemaName]; var attributeValue = referenceSchema && referenceSchema.attribute; var columnPath = attributeValue && (column.name + "." + attributeValue); if (columnPath && !esq.columns.contains(columnPath)) { esq.addColumn(columnPath); } } }, this); return esq; }, /** * @inheritdoc Terrasoft.BasePageV2#setColumnValues * @overridden */ setColumnValues: function(entity) { this.Terrasoft.each(this.columns, function(column) { if ((column.type === Terrasoft.ViewModelColumnType.ENTITY_COLUMN) && column.referenceSchemaName) { var columnName = column.name; var lookupValue = entity.get(columnName); if (!Ext.isEmpty(lookupValue)) { var referenceSchema = Terrasoft.configuration.EntityStructure[column.referenceSchemaName]; var attributeValue = referenceSchema && referenceSchema.attribute; var columnPath = attributeValue && (columnName + "." + attributeValue); if (columnPath) { var entityLookupValue = entity.get(columnPath); lookupValue[attributeValue] = entityLookupValue; this.set(columnPath, entityLookupValue); } } } }, this); this.callParent(arguments); } }, diff: /**SCHEMA_DIFF*/[]/**SCHEMA_DIFF*/ }; });
The necessary conditions and possible restrictions
When updating to versions in which the problem is already fixed, delete the above described replacing from the custom package.