Bug 7371 - Toaster managed mode: configuration variables page allows empty inputs into database
Summary: Toaster managed mode: configuration variables page allows empty inputs into d...
Status: VERIFIED FIXED
Alias: None
Product: Toaster
Classification: Build System, Metadata & Runtime
Component: toaster (show other bugs)
Version: 1.8
Hardware: x86 Multiple
: Medium major
Target Milestone: 1.8 M4
Assignee: David Reyna
QA Contact: Alexandru Roman
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2015-02-26 15:16 UTC by Ionut Chisanovici
Modified: 2015-11-26 13:25 UTC (History)
6 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: New (Never tested)
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ionut Chisanovici 2015-02-26 15:16:46 UTC
Hi,

For 1.8_M3.RC1, commit: 40d80f9e019118ac7bcd268f21e350bc154a4a63 but with git revert for cb23e3043bf5c07f111787287a321df0ece647dd, in project configuration variable page, user can add empty records into orm_projectvariable which is causing toaster to return errors.

To reproduce this:
1. Create a new project
2. Click on "Edit configuration variables"
3. Add a new var name and value
4. Click on the "Add variable" button
5. Click once again the "Add variable" button (the button remains active)

sqlite> select * from orm_projectvariable;
        id = 1
project_id = 1
      name = IMAGE_INSTALL_append
     value = 

        id = 2
project_id = 1
      name = PACKAGE_CLASSES
     value = package_rpm

        id = 3
project_id = 1
      name = MACHINE
     value = qemux86

        id = 4
project_id = 1
      name = SDKMACHINE
     value = x86_64

        id = 5
project_id = 1
      name = DISTRO
     value = poky

        id = 6
project_id = 1
      name = IMAGE_FSTYPES
     value = ext3 jffs2 tar.bz2

        id = 7
project_id = 2
      name = IMAGE_INSTALL_append
     value = 

        id = 8
project_id = 2
      name = PACKAGE_CLASSES
     value = package_rpm

        id = 9
project_id = 2
      name = MACHINE
     value = qemux86

        id = 10
project_id = 2
      name = SDKMACHINE
     value = x86_64

        id = 11
project_id = 2
      name = DISTRO
     value = poky

        id = 12
project_id = 2
      name = IMAGE_FSTYPES
     value = ext3 jffs2 tar.bz2
sqlite> select * from orm_projectvariable;
        id = 1
project_id = 1
      name = IMAGE_INSTALL_append
     value = 

        id = 2
project_id = 1
      name = PACKAGE_CLASSES
     value = package_rpm

        id = 3
project_id = 1
      name = MACHINE
     value = qemux86

        id = 4
project_id = 1
      name = SDKMACHINE
     value = x86_64

        id = 5
project_id = 1
      name = DISTRO
     value = poky

        id = 6
project_id = 1
      name = IMAGE_FSTYPES
     value = ext3 jffs2 tar.bz2

        id = 7
project_id = 2
      name = IMAGE_INSTALL_append
     value = 

        id = 8
project_id = 2
      name = PACKAGE_CLASSES
     value = package_rpm

        id = 9
project_id = 2
      name = MACHINE
     value = qemux86

        id = 10
project_id = 2
      name = SDKMACHINE
     value = x86_64

        id = 11
project_id = 2
      name = DISTRO
     value = poky

        id = 12
project_id = 2
      name = IMAGE_FSTYPES
     value = ext3 jffs2 tar.bz2

        id = 13
project_id = 1
      name = MACHINE
     value = genericx86

        id = 14
project_id = 1
      name = 
     value = 

Cheers,
Ionut C
Comment 1 David Reyna 2015-02-27 04:10:33 UTC
Here are the fix details:

  * When you add a variable, the “Add” button does now disable itself.

  * After testing, I also added code to disable “Add” when the variable name is set to empty. 

  * Finally, I added/fixed code to enforced the blocking of the variables that are managed outside this page, specifically BBLAYERS and MACHINE which are handled by the project detail page.
Comment 2 Alexandru Roman 2015-11-26 13:25:52 UTC
Verified.