Closed serviceticst closed 7 months ago
"When trying to paste a direct image into the follow-up, I receive the log below."
[2024-02-05 10:02:36] glpiphplog.NOTICE: *** PHP Deprecated function (8192): preg_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /usr/share/glpi/src/RichText/RichText.php at line 354 Backtrace : src/RichText/RichText.php:354 preg_replace() src/RichText/RichText.php:273 Glpi\RichText\RichText::fixImagesPath() src/RichText/RichText.php:63 Glpi\RichText\RichText::normalizeHtmlContent() src/RichText/RichText.php:301 Glpi\RichText\RichText::getSafeHtml() ...ion/View/Extension/DataHelpersExtension.php:230 Glpi\RichText\RichText::getEnhancedHtml() ...ates/d5/d540b4c3b3c68d964b4b49231baf2dc4.php:72 Glpi\Application\View\Extension\DataHelpersExtension->getEnhancedHtml() vendor/twig/twig/src/Template.php:171 TwigTemplate_0d76bbe6357706cb41617327808f1ada->block_timeline_card() ...ates/b6/b6b646eaec2ce642a74e258bd85cc4af.php:48 Twig\Template->displayBlock() vendor/twig/twig/src/Template.php:394 __TwigTemplate_8b3f5e324ff8e6d736ba68e90cd8eefb->doDisplay() vendor/twig/twig/src/Template.php:367 Twig\Template->displayWithErrorHandling() ...ates/d5/d540b4c3b3c68d964b4b49231baf2dc4.php:57 Twig\Template->display() vendor/twig/twig/src/Template.php:394 TwigTemplate_0d76bbe6357706cb41617327808f1ada->doDisplay() vendor/twig/twig/src/Template.php:367 Twig\Template->displayWithErrorHandling() vendor/twig/twig/src/Template.php:379 Twig\Template->display() vendor/twig/twig/src/TemplateWrapper.php:38 Twig\Template->render() .../twig/twig/src/Extension/CoreExtension.php:1347 Twig\TemplateWrapper->render() ...tes/65/65e66df5229dde3aa3acd3926a9bb301.php:425 twig_include() vendor/twig/twig/src/Template.php:394 TwigTemplate_e80683bcdf71030972f1ee4018467a25->doDisplay() vendor/twig/twig/src/Template.php:367 Twig\Template->displayWithErrorHandling() vendor/twig/twig/src/Template.php:379 Twig\Template->display() vendor/twig/twig/src/TemplateWrapper.php:38 Twig\Template->render() .../twig/twig/src/Extension/CoreExtension.php:1347 Twig\TemplateWrapper->render() ...tes/c8/c84988e98a37d1e08405f9f8988a87c3.php:131 twig_include() vendor/twig/twig/src/Template.php:394 TwigTemplate_054713728bbbd97852e4c1be33265494->doDisplay() vendor/twig/twig/src/Template.php:367 Twig\Template->displayWithErrorHandling() vendor/twig/twig/src/TemplateWrapper.php:45 Twig\Template->display() src/Application/View/TemplateRenderer.php:184 Twig\TemplateWrapper->display() src/Ticket.php:4426 Glpi\Application\View\TemplateRenderer->display() src/CommonGLPI.php:680 Ticket->showForm() ajax/common.tabs.php:120 CommonGLPI::displayStandardTab() public/index.php:82 require()
We have the same problem.
Hello, I would like to add to this issue as well.
It seems that the comment does get written to the Database and so does the image (or at least part of it in Base64). However, the content of the followup is empty.
This seems to happen when copy pasting an image rather than uploading it as an attachment. It also seems to happen more often when the image is of high resolution (size).
I believe it might be related to a memory issue or a SQL query that does not properly return the value for that followup.
This might be related with slowdowns during the Ticket load: https://github.com/glpi-project/glpi/issues/16529
Thank you.
Any feedback on this?
Hi,
The initial problem was that the image was not converted into a document when the ticket/followup was created. Increasing the pcre.backtrack_limit
PHP configuration value could solve the issue that appears at the ticket/followup creation.
The issue that appears at ticket/followup creation will be fixed in GLPI 11 by #14592.
For the tickets/followups that are already created, I have no solution to propose yet. I am not even sure it is possible to build a migration that would fix the data.
I can reproduce the problem in connection with my ticket #16529.
When I drag and drop an image into this field, there are several behaviors in GLPI.
Images up to approx. 500KB are displayed without any problems.
For images between 600KB and 4MB I only get an empty field.
and with images that are over 4-5MB in size, the ticket can no longer be opened and it just loads endlessly.
If I drag files and photos into the drag and drop field, it works without any problems.
The image is always displayed when I drag it in and it also says Upload Succesful, but after saving it, the specified problems occur.
Is this an error in the text field? Is it not even intended for this? And if not, shouldn't this function be disabled immediately and only be possible via the drag and drop field?
Oi,
O problema inicial era que a imagem não era convertida em documento no momento da criação do ticket/acompanhamento. Aumentar o
pcre.backtrack_limit
valor da configuração do PHP pode resolver o problema que aparece na criação do ticket/acompanhamento.O problema que aparece na criação do ticket/acompanhamento será corrigido no GLPI 11 por #14592 .
Para os tickets/acompanhamentos já criados, ainda não tenho solução para propor. Nem tenho certeza se é possível construir uma migração que conserte os dados.
@cedric-anne , pcre.backtrack_limit=200000, Would it be a good value?
I have now found out with an API query that if you load the photos directly into the comment field, they are probably stored base64 encoded directly in the database and this probably leads to the error.
After this follow-up has been deleted via the API, I can open the ticket again.
@cedric-anne , pcre.backtrack_limit=200000, Would it be a good value?
Maybe, it depends on the size of images you are trying to upload.
There is not much more we can do on the subject. Properly catching that kind of PHP error seems not possible.
Issue will be fixed in GLPI 11; workaround until upgrade is to update system configuration to a satisfying value for your needs.
Code of Conduct
Is there an existing issue for this?
Version
10.0.11
Bug description
When attaching a screenshot of a system's screen, for example, and pasting it into the ticket, then adding text beneath the image, upon saving the update, the entire entry goes blank, and nothing is saved, resulting in a loss of all information.
What we've noticed is that this happens occasionally; with some screenshots, it works fine, but with others, it produces this error.
While debugging, I captured this log.
[2024-01-26 16:39:42] glpiphplog.NOTICE: *** PHP Deprecated function (8192): preg_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /usr/share/glpi/src/RichText/RichText.php at line 355 Backtrace : src/RichText/RichText.php:355 preg_replace() src/RichText/RichText.php:273 Glpi\RichText\RichText::fixImagesPath() src/RichText/RichText.php:63 Glpi\RichText\RichText::normalizeHtmlContent() src/RichText/RichText.php:301 Glpi\RichText\RichText::getSafeHtml() ...ion/View/Extension/DataHelpersExtension.php:230 Glpi\RichText\RichText::getEnhancedHtml() ...ates/45/45d99573ccfc69c8ceb3446fd882fc54.php:72 Glpi\Application\View\Extension\DataHelpersExtension->getEnhancedHtml() vendor/twig/twig/src/Template.php:171 TwigTemplate_d07c909c36db53191bd03277432ebb9f->block_timeline_card() ...ates/a4/a4a2db6ed5602e71abd50e76ae8800be.php:48 Twig\Template->displayBlock() vendor/twig/twig/src/Template.php:394 __TwigTemplate_4bff84a61e9b886d83310ebf90c196f0->doDisplay() vendor/twig/twig/src/Template.php:367 Twig\Template->displayWithErrorHandling() ...ates/45/45d99573ccfc69c8ceb3446fd882fc54.php:57 Twig\Template->display() vendor/twig/twig/src/Template.php:394 TwigTemplate_d07c909c36db53191bd03277432ebb9f->doDisplay() vendor/twig/twig/src/Template.php:367 Twig\Template->displayWithErrorHandling() vendor/twig/twig/src/Template.php:379 Twig\Template->display() vendor/twig/twig/src/TemplateWrapper.php:40 Twig\Template->render() .../twig/twig/src/Extension/CoreExtension.php:1349 Twig\TemplateWrapper->render() ...tes/ec/ec6cbb8a2efe766fe2b94b1b85106708.php:425 twig_include() vendor/twig/twig/src/Template.php:394 TwigTemplate_cf9582a178c9aed3fd76ab8a0bf60b2b->doDisplay() vendor/twig/twig/src/Template.php:367 Twig\Template->displayWithErrorHandling() vendor/twig/twig/src/Template.php:379 Twig\Template->display() vendor/twig/twig/src/TemplateWrapper.php:40 Twig\Template->render() .../twig/twig/src/Extension/CoreExtension.php:1349 Twig\TemplateWrapper->render() ...tes/24/24ef781d212992b008f998231b80b473.php:131 twig_include() vendor/twig/twig/src/Template.php:394 TwigTemplate_c861bb866645fae902b77b643975f9f3->doDisplay() vendor/twig/twig/src/Template.php:367 Twig\Template->displayWithErrorHandling() vendor/twig/twig/src/TemplateWrapper.php:47 Twig\Template->display() src/Application/View/TemplateRenderer.php:184 Twig\TemplateWrapper->display() src/Ticket.php:4426 Glpi\Application\View\TemplateRenderer->display() src/CommonGLPI.php:680 Ticket->showForm() ajax/common.tabs.php:120 CommonGLPI::displayStandardTab() public/index.php:82 require()
Relevant log output
Page URL
http://192.168.101.5/
Steps To reproduce
No response
Your GLPI setup information
Instruções de instalação e configuração
Server
GLPI constants
Libraries
SQL replicas
Notifications
Plugins list
Anything else?
No response