28. 09. 2026 Alessandro Paoli Asset Management, NetEye

How to Associate Custom Fields with New Itemtypes in GLPI (Fields Plugin)

When you create custom fields with the Fields plugin for GLPI, the container defines which itemtypes show the new tab. If you later need to add more itemtypes (for example Certificate or Domain), the web interface isn’t enough: you have to work directly on the database.

In this article we explain why a manual intervention is needed, and walk through the full procedure including the checks and fixes required to avoid incomplete tables.

Neteye version 4.49
GLPI 11.0.9
Plugin Fields 1.24.5

Why This Procedure Is Needed

The Fields plugin doesn’t modify GLPI’s native tables. For each container it generates dedicated structure and code, and it does so for every container × itemtype pair:

  • A dedicated table. Custom field values aren’t stored in glpi_computers, but in a table named glpi_plugin_fields_<itemtype><containername>s. For the neteyeperimeter container we get glpi_plugin_fields_computerneteyeperimeters, glpi_plugin_fields_printerneteyeperimeters, and so on. Each row links an object (items_id and itemtype) to its container (plugin_fields_containers_id).
  • A PHP class generated on disk. The plugin creates a class from a template for each pair, plus an injection class for Datainjection (the procedure includes making a backup of the plugin’s inc folder).

These tables and classes are created at two moments: When the container is created, and during the plugin’s installation or update. In both cases the plugin reads the container’s itemtypes column and creates whatever’s missing.

The critical point is this: Itemtypes are chosen and validated only at creation time. The container update code handles changes to the label, but it doesn’t have a path for changing the itemtypes. That’s why the interface doesn’t let you edit them in an existing container.

However, by editing the itemtypes column by hand and reinstalling the plugin, you take advantage of an existing mechanism. The installation routine re-reads all containers, regenerates the class files, and runs the table installation for every itemtype listed in itemtypes. Classes and tables therefore appear for the new itemtypes as well.

The problem is that these tables are created with the base schema, meaning only the technical columns. The columns of the individual custom fields aren’t added. The result is a tab that shows up but has no usable fields. Hence the correction step (Step 4), which recreates the table by copying it from one that’s already complete.

Practical consequences:

  • The intervention is manual and must be repeated for every new itemtype and every container
  • Behavior may change with plugin updates, so re-check after each upgrade
  • If you can, select all the itemtypes you might need right when you create a container, even if it seems like too many, so you don’t have to worry about corrections later

Before You Start: Which Containers Can Be Modified?

We verified the procedure below on containers of type tab. To check the type of your containers, run this query on the database:

SELECT id, name, type, subtype, itemtypes FROM glpi_plugin_fields_containers;


| id | name                       | type | subtype | itemtypes                                 |
+----+----------------------------+------+---------+-------------
|  8 | authorized                 | tab  | NULL    | ["Software"]                              |
| 19 | neteye                     | tab  | NULL    | ["Computer","NetworkEquipment","Printer"] |
| 30 | esdataset                  | dom  | NULL    | ["PluginFieldsLogsourcefieldDropdown"]    |

Check the type column. In our case IDs 8 and 19 are of type tab. We didn’t modify dom containers (fields inserted directly into the object’s main form) and we don’t guarantee the procedure works for them.

Step 1: Backup

Before touching anything, back up the database and the plugin files.

To back up the GLPI database, run:

mysqldump glpi > bck_glpi.sql

To back up the plugin’s inc folder, run:

cp -a /neteye/shared/glpi/data/files/plugins/fields/inc ./bck_fields_inc

Step 2: Update the Container’s Itemtypes

Update the glpi_plugin_fields_containers table, listing all the itemtypes in which you want to see the tab, not only the new ones, because the field is overwritten in full.

UPDATE glpi_plugin_fields_containers
SET itemtypes = '["Computer","NetworkEquipment","Printer","Phone","PDU","PassiveDCEquipment","Certificate","Database","Domain"]'
WHERE id IN (19);

Step 3: Reinstall the Plugin and Clear the Cache

From the GLPI container, force a reinstall of the plugin and clear the cache:

podman exec -u 33 -it <glpi_container> php bin/console plugin:install --force --username=<admin user> fields
podman exec -u 33 -it <glpi_container> php bin/console cache:clear

Then log in to the GLPI web console and re-enable the “Additional fields” plugin.

Step 4: Fix the Tables Created by the Plugin

After the reinstall, the plugin creates the table for each new itemtype, but only with the base columns. For example, for Certificate:

MariaDB [glpi]> desc glpi_plugin_fields_certificateneteyeperimeters;

| Field                       | Type             | Null | Key | Default     | Extra          |
+-----------------------------+------------------+------+-----+-------------+------
| id                          | int(10) unsigned | NO   | PRI | NULL        | auto_increment |
| items_id                    | int(10) unsigned | NO   |     | NULL        |                |
| itemtype                    | varchar(255)     | YES  | MUL | Certificate |                |
| plugin_fields_containers_id | int(10) unsigned | NO   |     | 19          |                |
| entities_id                 | int(10) unsigned | NO   | MUL | 0           |                |
| is_recursive                | tinyint(4)       | NO   | MUL | 0           |                |

All the custom field columns are missing. To get a complete table that’s correctly linked to the container, recreate it by copying the structure from a table that’s already correct, such as the Computer one.

Warning: DROP TABLE also deletes the data. If the table already contains values, export them first. If you have just created it through the reinstall, it’s normally empty.

-- 1. Drop the incomplete table
DROP TABLE glpi_plugin_fields_certificateneteyeperimeters;

-- 2. Recreate it by copying the structure from a complete table
--    (the Computer table is already correctly linked to the container)
CREATE TABLE glpi_plugin_fields_certificateneteyeperimeters
LIKE glpi_plugin_fields_computerneteyeperimeters;

-- 3. Set the correct default value for the itemtype column
ALTER TABLE glpi_plugin_fields_certificateneteyeperimeters
ALTER COLUMN itemtype SET DEFAULT 'Certificate';

The third command is needed because the copy carries over the default of the source table (Computer).

Repeat these three commands for every new itemtype and every container you modified, adapting the table name (glpi_plugin_fields_<itemtype><containername>s) and the default value of itemtype.

Summary

  1. Check that the container is of type tab
  2. Back up the database and the inc folder
  3. Update itemtypes in glpi_plugin_fields_containers
  4. Reinstall the plugin with --force, clear the cache, and re-enable “Additional fields”
  5. Recreate the tables for the new itemtypes by copying them from a complete table, and fix the default of itemtype

By following these steps, the new tabs will appear on all the desired itemtypes, with all fields available.

These Solutions are Engineered by Humans

Did you find this article interesting? Does it match your skill set? Our customers often present us with problems that need customized solutions. In fact, we’re currently hiring for roles just like this and others here at Würth IT Italy.

Alessandro Paoli

Alessandro Paoli

My name is Alessandro Paoli and I've been a Technical Consultant at Wurth IT Italy since May 2024. I've always had a great passion for IT and since 2004 it has also become my job. In 2015 I found my role in the field, monitoring. I have had the opportunity to use various monitoring products, both open source and proprietary, I have worked on numerous projects from small businesses to global companies. I am married and have 2 wonderful daughters. My passions are travel, cinema, games (video and board) and comics, and every now and then I manage to indulge in a few days of sport (Padel and gym).

Author

Alessandro Paoli

My name is Alessandro Paoli and I've been a Technical Consultant at Wurth IT Italy since May 2024. I've always had a great passion for IT and since 2004 it has also become my job. In 2015 I found my role in the field, monitoring. I have had the opportunity to use various monitoring products, both open source and proprietary, I have worked on numerous projects from small businesses to global companies. I am married and have 2 wonderful daughters. My passions are travel, cinema, games (video and board) and comics, and every now and then I manage to indulge in a few days of sport (Padel and gym).

Leave a Reply

Your email address will not be published. Required fields are marked *

Archive