partkeepr

fork of partkeepr
git clone https://git.e1e0.net/partkeepr.git
Log | Files | Refs | Submodules | README | LICENSE

commit 5a5a0f9651f8270628df04842bccba7f8b243331
parent 1feed08383eddffc26ba4e522be456dd588337b2
Author: Felicitus <felicitus@felicitus.org>
Date:   Fri,  4 Sep 2015 18:41:07 +0200

Fixed correction of invalid manufacturer/distributor records

Diffstat:
Msrc/PartKeepr/FrontendBundle/Resources/public/js/Components/Part/Editor/PartEditor.js | 17++---------------
1 file changed, 2 insertions(+), 15 deletions(-)

diff --git a/src/PartKeepr/FrontendBundle/Resources/public/js/Components/Part/Editor/PartEditor.js b/src/PartKeepr/FrontendBundle/Resources/public/js/Components/Part/Editor/PartEditor.js @@ -315,7 +315,7 @@ Ext.define('PartKeepr.PartEditor', { * that the record is invalid and being removed. */ for (j = 0; j < this.record.distributors().getCount(); j++) { - if (this.record.distributors().getAt(j).get("distributor_id") === 0) { + if (this.record.distributors().getAt(j).getDistribor() === null) { removeRecords.push(this.record.distributors().getAt(j)); } } @@ -351,7 +351,7 @@ Ext.define('PartKeepr.PartEditor', { */ for (j = 0; j < this.record.manufacturers().getCount(); j++) { - if (this.record.manufacturers().getAt(j).get("manufacturer_id") === 0) { + if (this.record.manufacturers().getAt(j).getManufacturer() === null) { removeRecords.push(this.record.manufacturers().getAt(j)); } } @@ -360,19 +360,6 @@ Ext.define('PartKeepr.PartEditor', { this.record.manufacturers().remove(removeRecords); } - /** - * Check if the storage location is valid. If not, try an exact, case-insensitive match for the - * storage location name and inject that into the record. - */ - if (isNaN(this.record.get("storageLocation"))) { - var storageLocationRecord = this.storageLocationComboBox.getStore().findRecord( - "name", - this.storageLocationComboBox.getValue(), - 0, false, false, true); - - this.record.set("storageLocation", storageLocationRecord.get("id")); - } - // Force footprint to be "null" when the checkbox is checked. if (this.footprintNone.getValue() === true) { this.record.setFootprint(null);