Skip to content

Data truncated for column 'old_id' at row 1 #559

@minguezdvd-ai

Description

@minguezdvd-ai

Hello,

I am encountering an SQL error when trying to perform a massive reception of orders (10 computers at once) using the Order plugin in GLPI.

When I launch the massive action to receive the items, the following MySQL error is generated:

MySQL query error: Data truncated for column 'old_id' at row 1 (1265)

SQL query:
INSERT INTO glpi_logs
(items_id, itemtype, itemtype_link, linked_action, user_name,
date_mod, id_search_option, old_value, old_id, new_value, new_id)
VALUES
('10449', 'Computer', '', '0', 'Theo (2958)',
'2026-02-24 14:05:55', '121',
'PC-11070009 (2026-02-24 14:05:55)',
'2026-02-24 14:05:55',
'PC-11070008 (2025-12-09 13:36:40)',
'2025')
Error Details

MySQL error code: 1265

Error message: Data truncated for column 'old_id' at row 1

The issue occurs during logging (glpi_logs table insertion).

It seems that a datetime value (2026-02-24 14:05:55) is being inserted into the old_id column, which likely expects an integer.

Stack Trace
In ./src/DBmysql.php(405)
#0 ./src/DBmysql.php(1360): DBmysql->doQuery()
#1 ./src/Log.php(298): DBmysql->insert()
#2 ./src/Log.php(211): Log::history()
#3 ./src/CommonDBTM.php(747): Log::constructHistory()
#4 ./src/CommonDBTM.php(1763): CommonDBTM->updateInDB()
#5 ./marketplace/order/inc/link.class.php(864): CommonDBTM->update()
#6 ./marketplace/order/inc/link.class.php(1016): PluginOrderLink->generateInfoComRelatedToOrder()
#7 ./marketplace/order/inc/link.class.php(1297): PluginOrderLink->createLinkWithItem()
#8 ./marketplace/order/inc/reception.class.php(1227): PluginOrderLink->generateNewItem()
#9 ./marketplace/order/inc/reception.class.php(1085): PluginOrderReception::generateAsset()
#10 ./marketplace/order/inc/reception.class.php(784): PluginOrderReception->updateReceptionStatus()
#11 ./src/MassiveAction.php(1323): PluginOrderReception::processMassiveActionsForOneItemtype()
#12 ./src/MassiveAction.php(1301): MassiveAction->processForSeveralItemtypes()
#13 ./front/massiveaction.php(63): MassiveAction->process()
Additional Information

The issue only happens during massive reception.

Receiving items individually does not seem to trigger the error.

It looks like a mismatch between the expected datatype of old_id and the value being passed during log history generation.

Could you please investigate whether this is a bug in the Order plugin related to logging during massive actions?

Thank you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions