iTop icon indicating copy to clipboard operation
iTop copied to clipboard

:sparkles: Add support for AttributeClass from XML

Open GurneyHallack opened this issue 2 years ago • 7 comments

Hello,

When creating an attribute of type "AttributeClass" from PHP, it's working.

When creating an attribute of type "AttributeClass" from XML, there are two parameters that are not taken from the XML :

  • class_category
  • more_values

Thus, it generates an error on compilation (setup): 2022-02-26 08_55_39-Window_itop_error Notice: Undefined index: class_category in /var/www/html/web/core/attributedef.class.inc.php Notice: Undefined index: more_values in /var/www/html/web/core/attributedef.class.inc.php

I didn't found a testCase for testing the Compiler creating attributes. If you point me to it, I would gladly add the adequate test.

Have a good snowy day (April joke here :) )

GurneyHallack avatar Apr 01 '22 06:04 GurneyHallack

I'm not sure this is meant to be used with xml, as this type is also not documented in the xml data model reference wiki page.

Hipska avatar Apr 01 '22 07:04 Hipska

Then, why the compiler manages the case of "AttributeClassAttCodeSet", even if it is also not documented in the xml data model reference ? The case in the compiler for "AttributeClassAttCodeSet" was added with https://github.com/Combodo/iTop/commit/ec597f697a912d05dc5d5f8f8f1bd4d4436e4ddd, after the commit "N°917: AttributeClassAttCodeSet created" https://github.com/Combodo/iTop/commit/720d33405305e295b7afb1c81a54e5d49dc047b3

GurneyHallack avatar Apr 01 '22 07:04 GurneyHallack

🤷 Don't ask me … 😂

Hipska avatar Apr 01 '22 07:04 Hipska

Hello, Thanks for the PR !

AttributeClass was created a long time ago, I think before XML customization was added. This was certainly forgotten when XML was added as a possible source...

Can you share a XML with such a field ?

piRGoif avatar Apr 04 '22 15:04 piRGoif

@piRGoif could you in the meantime make sure the attribute is described in the documentations?

Hipska avatar Apr 07 '22 12:04 Hipska

could you in the meantime make sure the attribute is described in the documentations?

Documenting or not will be decided during the functional review of this PR.

piRGoif avatar Apr 07 '22 13:04 piRGoif

datamodel.pull-283-sample.xml.txt Hello, Here's an xml file (.txt) with the AttributeClass field. The first class is the minimalist declaration, the second one is a simple one. Would that be good ?

GurneyHallack avatar Apr 22 '22 08:04 GurneyHallack

Hello @GurneyHallack , sorry for the long response time. This was fixed in iTop 3.2.0 which will be released this year.

Molkobain avatar Mar 13 '24 13:03 Molkobain

@Molkobain So will it now be documented?

Hipska avatar Mar 13 '24 13:03 Hipska

Yep, it will be documented on iTop 3.2 wiki which will be available along with the package.

Molkobain avatar Mar 13 '24 14:03 Molkobain