1
0
-1

We are trying to add our own environment to the available choices for the device details-> Environment field. We completed the form available from the Manage menu->Attributes->Create Attribute.

In our list of attributes we see our new attribute ( "System Integration Testing" )

After we check the green checkmark all appears well. However, after we reload the page, the value reverts to what appears to be the default ( "Development" )

    CommentAdd your comment...

    1 answer

    1.  
      1
      0
      -1

      Thanks for asking this question. It seems there is a bug (a spelling mistake is all) in the code.

      Unfortunately, device environment is an enum in the database (a list of defined values), so adding an attribute and value will not take effect.

      HOWEVER - we can patch the code and change the database so it will work. These will be included in the next release, so if you're not confident in making these changes, just install the next release and it will be taken care of for you.

      To fix the bug (spelling mistake), in the file -

      LINUX

      /usr/local/open-audit/www/open-audit/js/open-audit.js

      WINDOWS

      c:\xampplite\htdocs\open-audit\js\open-audit.js

      Edit line 364 (or search for device_environmant) and change the line from:

      $("#data\\[attributes\\]\\[type\\]").append($('<option>', { value: 'device_environmant', text: 'Environment' }));

      to

      $("#data\\[attributes\\]\\[type\\]").append($('<option>', { value: 'device_environment', text: 'Environment' }));

       

      Now to enable this in the database, run the below command:

      LINUX

      mysql -u openaudit -popenauditpassword -e "USE openaudit; ALTER TABLE system CHANGE environment environment varchar(100) NOT NULL DEFAULT 'production';  ALTER TABLE system CHANGE class class varchar(100) NOT NULL DEFAULT '';"

      WINDOWS

      cd c:\xampplite\mysql\bin
       
      mysql -u openaudit -popenauditpassword -e "USE openaudit; ALTER TABLE system CHANGE environment environment varchar(100) NOT NULL DEFAULT 'production';  ALTER TABLE system CHANGE class class varchar(100) NOT NULL DEFAULT '';"

      You might have noticed that we also changed the 'class' attribute. This is in the same position as 'environment' in that in the database it's an enum - a defined list of values. Adding a 'class' attribute in the application would not be enough to use it. Setting the attribute to a varchar (a text field) will enable this (same as 'environment').

       

      Apologies for the bug. You will need to delete and re-add your device environment attribute for this to populate correctly.

        CommentAdd your comment...