-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"Error when attaching some screenshots directly to the ticket." #16444
Comments
"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 |
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). This seems to happen when copy pasting an image rather than uploading it as an attachment. 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: #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 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? |
@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
The text was updated successfully, but these errors were encountered: