Menu

Undefined variable $ibo

2023-05-30
2023-05-31
  • Rafael AINCIART

    Rafael AINCIART - 2023-05-30

    Hi everyone!
    I'm developing an extension in order to customize UserRequest datamodel.
    I used to do this kind of work but with version 2.8.
    Now, every time I make a change (simplify) in the lifecycle and status field, I get this error during the setup :
    Undefined variable $ibo
    It refers to /env-production/itop-request-mgmt/model.itop-request-mgmt.php and this line of code :
    MetaModel::Init_AddAttribute(new AttributeEnum("status", array("allowed_values"=>new ValueSetEnum("new$ibo-lifecycle-new-state-primary-color$ibo-lifecycle-new-state-secondary-color,approved$ibo-lifecycle-success-state-primary-color$ibo-lifecycle-success-state-secondary-colorfas fa-user-check,rejected$ibo-lifecycle-failure-state-primary-color$ibo-lifecycle-failure-state-secondary-colorfas fa-user-times,assigned$ibo-lifecycle-neutral-state-primary-color$ibo-lifecycle-neutral-state-secondary-color,pending$ibo-lifecycle-waiting-state-primary-color$ibo-lifecycle-waiting-state-secondary-colorfas fa-hourglass-half,escalated_tto$ibo-lifecycle-failure-state-primary-color$ibo-lifecycle-failure-state-secondary-colorfas fa-fire,escalated_ttr$ibo-lifecycle-failure-state-primary-color$ibo-lifecycle-failure-state-secondary-colorfas fa-fire,resolved$ibo-lifecycle-success-state-primary-color$ibo-lifecycle-success-state-secondary-colorfas fa-check,closed$ibo-lifecycle-frozen-state-primary-color$ibo-lifecycle-frozen-state-secondary-color"), "default_style"=> new ormStyle('ibo-dm-enum--UserRequest-status', 'ibo-dm-enum-alt--UserRequest-status', 'var(--ibo-dm-enum--UserRequest-status--main-color)', 'var(--ibo-dm-enum--UserRequest-status--complementary-color)', null, null), "display_style"=>'list', "sql"=>'status', "default_value"=>'new', "is_null_allowed"=>false, "depends_on"=>array(), "always_load_in_tables"=>true)));

    Can you help me to understand how I have to manage this error?
    Many thanks!

    Rafael.

     

    Last edit: Rafael AINCIART 2023-05-30
  • Jeffrey Bostoen

    Jeffrey Bostoen - 2023-05-31

    Might be best to share your extension, as something in it is most likely causing this issue.

    You used to do this kind of work with version 2.8, which doesn't exist. So which iTop version are you really on right now? Still on 2.7? (2.7.8?) Or already on the newer 3.0 version?

     
  • Guillaume Lajarige

    Hello Rafael,

    $ibo-xxx are SCSS variables used in the backoffice theme. From what I see in the code your pasted, it seems that your enum definition is not correct. Can you share your XML so we can point to you to a synthax error in the XML?

    Thanks,
    Guillaume

     
    • Rafael AINCIART

      Rafael AINCIART - 2023-05-31

      I'm not familiar with SCSS. Perhaps there is a server setting that I have to allows SCSS execution?

       
  • Rafael AINCIART

    Rafael AINCIART - 2023-05-31

    Hi Jeffrey & Guillaume!
    I share with you this simple code where I try to redefine Ticket and UserRequest classes in order to get a simplified lifecycle.
    But I'm unable to compile it. I always get this error "Undefined variable $ibo".
    I notice in itop v3.0.3, it has been added tags for styling which refer to this variable $ibo-xxx.
    Thanks for your help!
    Rafael.

     
  • Guillaume Lajarige

    Try changing the version from 1.6 to 3.0 in the first lines of the XML.
    You are running iTop 3.0.x right?

    Also, you don't have to redefine the whole status attribute, you can just add / remove what you need :)

    Hope this helps,
    Guillaume

     
    • Rafael AINCIART

      Rafael AINCIART - 2023-05-31

      Ok Guillaume!
      Changing the version solves the issue :)
      Nice!!!
      I use to fill this form to generate empty extensions :
      https://www.itophub.io/wiki/page?id=3_0_0:customization:datamodel
      I didn't know I have to adapt the version.
      Many thanks for your help and your work!
      Rafael.

       
  • Guillaume Lajarige

    Glad to see you fixed it! :)

    Cheers,
    Guillaume

     

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.