Bug 8300

Summary: The name check while importing a layer fails
Product: [Build System, Metadata & Runtime] Toaster Reporter: Belen Barros Pena <belen.barros.pena>
Component: toasterAssignee: Michael Wood <michael.g.wood>
Status: VERIFIED FIXED QA Contact: Alexandru Roman <alexandru.costinx.roman>
Severity: normal    
Priority: Medium CC: alexandru.costinx.roman, belen.barros.pena, jessica.zhang, stanciux.mihail
Version: 1.8   
Target Milestone: 2.0   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)

Description Belen Barros Pena 2015-09-15 14:47:18 UTC
Found in master:ea562de57590c966cd5a75fda8defecd397e6436

Steps to reproduce:

* Create a Toaster project with release 'master'
* Click on the 'import layer' tab
* Enter a layer name that already exists for that project (eg. meta-oe)

When you focus out of the name field, the 'loading' notification appears, but the name check never completes and you can merrily proceed to import the layer, generating a duplicate. 

The browser console shows the following error:

Uncaught TypeError: Cannot read property 'length' of undefined
importlayer.js:217
Comment 1 Belen Barros Pena 2015-09-15 14:50:43 UTC
By the way, we might think of checking the layer name also on submitting the form. That would have prevented me from importing the layer with an already existing name. Since I was able to import the layer, I am assuming the check is not happening on submit, only on focus out in the layer name field.
Comment 3 Alexandru Roman 2015-11-06 12:51:30 UTC
Verified on master: fc45deac89ef63ca1c44e763c38ced7dfd72cbe1