Skip to content

[main] Fix: handle tickets without creation date on update - #407

Merged
Herafia merged 1 commit into
mainfrom
forward-port/406-to-main
Nov 20, 2026
Merged

Herafia merged 1 commit into
mainfrom
forward-port/406-to-main

Conversation

@glpi-project

@glpi-project glpi-project Bot commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

Forward-port of #406 to main.

Checklist before requesting a review

Please delete options that are not relevant.

  • I have performed a self-review of my code.
  • I have added tests (when available) that prove my fix is effective or that my feature works.
  • I have updated the CHANGELOG with a short functional description of the fix or new feature.
  • This change requires a documentation update.

Description

  • It fixes Error DatetimeException when transfering item from an entity to another one #395
  • Updating a ticket that has no creation date (legacy or migrated data) raised an exception in the tag plugin, aborting operations such as transferring assets and their linked tickets to another entity.
  • Such tickets are now handled like any existing ticket, so the update completes normally.
  • Also restores a missing closing brace in TagItemTest.php that prevented the test file from loading.
glpi.ERROR:   *** Caught Safe\Exceptions\DatetimeException: An error occurred
  Backtrace :
  ...fe/generated/Exceptions/DatetimeException.php:9
  ...dingmachine/safe/generated/8.2/datetime.php:337 Safe\Exceptions\DatetimeException::createFromPhpError()
  ./marketplace/tag/inc/tagitem.class.php:478        Safe\strtotime()
  ./src/Plugin.php:1810                              PluginTagTagItem::updateItem()
  ./src/CommonDBTM.php:1685                          Plugin::doHook()
  ./src/Transfer.php:3227                            CommonDBTM->update()
  ./src/Transfer.php:1217                            Transfer->transferTickets()

Screenshots (if appropriate):

@glpi-project

glpi-project Bot commented Nov 17, 2026

Copy link
Copy Markdown
Contributor Author

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin forward-port/406-to-main
git worktree add --checkout .worktree/forward-port/406-to-main forward-port/406-to-main
cd .worktree/forward-port/406-to-main
git reset --hard HEAD^
git cherry-pick -x 7e9b4c26de7eaa033270ce565f7f61e365db82d1

@Rom1-B
Rom1-B force-pushed the forward-port/406-to-main branch from cc7702c to 29d0f93 Compare November 17, 2026 09:31
@Rom1-B
Rom1-B requested review from a team, Herafia, MyvTsv and RomainLvr and removed request for a team November 17, 2026 09:33
@Rom1-B
Rom1-B marked this pull request as ready for review November 17, 2026 13:07
@Herafia
Herafia merged commit 935bb5e into main Nov 20, 2026
7 checks passed
@Herafia
Herafia deleted the forward-port/406-to-main branch November 20, 2026 10:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error DatetimeException when transfering item from an entity to another one

2 participants