Menu

How to define colors on enum

max
2022-02-16
2023-09-04
  • max

    max - 2022-02-16

    Hi!
    I tried to follow the tutorial from combodo for a custom enum style.
    Link --> https://www.itophub.io/wiki/page?id=3_0_0%3Acustomization%3Aenum-colors

    First i created a new extension and installed it with the itop install wizard.
    Then i created a new class with a enum field.
    I used the style tag as descripted in the tutorial.

    After saving i updated my iTop instance and it crashed...

    I found the problem in my database and with same help frome the toolkit

    The enum values get the style infromation added to there values.

    For example since 3.0 the itop request managment used this tags as well.
    The database shows in itop request ticket no unnormal data in the valid status values.

    If i use the toolkit to update my code to the extension, it tries to add the values from the enum inculding the style information.

    The attachmends are my code for the enum field and the error message in the installtion.
    Without the style tag will itop install my extension.
    If i use the style tag in aother value tag of the enum and the default value as no style tag it installed the extension as well but the database valid values is corrapted with this false data. Shown in the last attachment.

    Thanks a lot for your attention.

     
  • Vincent @ Combodo

    Thanks max for reporting this. It's probably related to the Toolkit behavior, because we have never seen this behavior while using the Setup or the ITSM Designer to define colors and style on an enum value.
    Do you have the latest version of the Toolkit? or which version do you have ?

     
  • max

    max - 2022-02-16

    Hi Vincent,

    the last commit from my toolkit version is 07bc388 from the following git repo: https://github.com/Combodo/itop-toolkit-community

    I guess this is the latest version.

     
  • max

    max - 2022-02-16

    I tried the toolkit version that you gave me and its the same error.
    The error happens also in the install wizard for a fresh itop install.

     
  • Vincent @ Combodo

    Once your data in database are corrupted, nothing can work anymore. I am just wondering how you endup in this situation where iTop Toolkit (or iTop Setup, but I suspect that it's rather iTop Toolkit) has corrupted your database, changing the enum allowed values with something very wrong...

     
  • max

    max - 2022-02-17

    Do you have any suggestion to give more information or what i can do?

    P.S. I use itop community 3.0.0

     
  • Pierre Goiffon

    Pierre Goiffon - 2022-02-17

    Hello,

    Max can you share your xml code in plain text instead of an image ? So we can try to reproduce on our side ?

    About the toolkit, I would strongly advice against using directly a clone from the repo : development versions can be buggy, it is a very risky choice !
    You should stick to the official 3.0.0 toolkit available on the wiki or tagged in the repo.

     
  • max

    max - 2022-02-17

    My extension as zip

     

    Last edit: max 2022-02-17
  • Pierre Goiffon

    Pierre Goiffon - 2022-02-28

    Hello,

    Your XML version is set to 1.6, whereas the field/values/value/style node was added in version 3.0... Reference : https://www.itophub.io/wiki/page?id=latest:customization:xml_reference#version_30

    You should get a better error message when making such a mistake though, I referenced this bug as N°4870 in Combodo's internal DB

     
  • max

    max - 2022-03-01

    Hello Pierre,

    this solved the problem. Thank you!

    But just you the future you should update the module creation wizard (https://www.itophub.io/wiki/page?id=3_0_0%3Acustomization%3Adatamodel#creating_a_module). I did downloaded the base for this extension from there for version 3.0

     
  • Pierre Goiffon

    Pierre Goiffon - 2022-03-01

    Hello,

    Thanks for the feedback !

    About the XML generated by the wizard, we did imply creating an XML file with an old iTop version : if we don't the extension would be compatible with fewer versions of iTop !

     
  • Merey Omirbek

    Merey Omirbek - 2023-09-04

    Good day of the day!

    After I changed
    <itop_design xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.0"> to <itop_design xmlns:xsi="http://www.w3.org/2001/XMLSchema -instance" version="3.0">
    there were styles for fields. but the jump buttons are gone.
    and when unloading all requests, an error occurs
    Failed to issue SQL query: query = SELECT AccessMonitoringSystem.AS `__state__`, COUNT(DISTINCT COALESCE(`AccessMonitoringSystem`.`id`, 0)) AS _itop_count_ FROM `access_monitoring_system` AS `AccessMonitoringSystem` WHERE 1 GROUP BY `AccessMonitoringSystem`. , mysql_errno = 1054, mysql_error = Unknown column 'AccessMonitoringSystem.' in 'field list'
    who can tell?</itop_design></itop_design>

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.