Bug #105737
closedIndexed search causes crash
0%
Description
After inserting a link, saving and displaying it, I get the following error:
See error log.
Files
Updated by Guido Twieling about 2 months ago
Forgot to write: After refreshing (F5) the page is displayed. The page that was created shows a simple 5-column table with download links for files. What I also noticed is that the alt text and target _blank are deleted after repeated saving.
Updated by Chris Müller about 2 months ago
Looks like an error occurred in using preg_replace(), for whatever reason:
https://www.php.net/manual/en/function.preg-replace.php#refsect1-function.preg-replace-returnvalues
Then $bodyDescription is set to null.
Updated by Garvin Hicking about 2 months ago
- Status changed from New to Needs Feedback
Could you please give more details where exactly you insert what. Thank you!
Updated by Guido Twieling about 2 months ago
- File source after reopen.txt source after reopen.txt added
- File source before saveing.txt source before saveing.txt added
Hello.
I just inserted a text element with a table. I attached the CKeditor source code.
Updated by Garvin Hicking about 1 month ago
I tried to reproduce this but could not get the error you describe.
You seem to be using special configuration or plugins because you're using `<img>` tags in the RTE which isn't possible by default. Can you please also post your CKEditor YAML configuration?
To speed up debugging maybe we can check what's going on with the failing regular expression. Could you edit your file /var/www/html/vendor/typo3/cms-indexed-search/Classes/Indexer.php
and in Line 877 replace this:
$bodyDescription = preg_replace('/\s+/u', ' ', $indexingDataDto->body); // Shorten the string. If the database has the wrong character set, // the string is probably truncated again. $bodyDescription = \mb_strcut($bodyDescription, 0, $maxL, 'utf-8');
to this:
$bodyDescription = preg_replace('/\s+/u', ' ', $indexingDataDto->body); $fp = fopen('/var/www/html/var/typo3temp/ckeditor.log', 'a'); fwrite($fp, "Input bodyDescription:\n" . $indexingDataDto->body . "\n----After replacement:\n" . $bodyDescription . "\n====\n"); // Shorten the string. If the database has the wrong character set, // the string is probably truncated again. $bodyDescription = \mb_strcut($bodyDescription, 0, $maxL, 'utf-8');
Then it should create a logfile in /var/www/html/var/typo3temp/ckeditor.log
which you could post after saving and the error occurs.
You could try if this helps:
$bodyDescription = (string) preg_replace('/\s+/u', ' ', $indexingDataDto->body);
This should prevent a possible preg_replace output to be null (but would then not index anything, so that's just a workaround for the PHP error, not a real fix).
Updated by Guido Twieling about 1 month ago · Edited
Hello Garvin.
I have attached the ckeditor.log. I tested it a bit. The error only occurs when I link files. When I look at the log, it contains the content of the linked files.
Updated by Guido Twieling about 1 month ago
- File ckeditor.log ckeditor.log added
Updated by Garvin Hicking about 1 month ago
- Status changed from Needs Feedback to Closed
Thanks for the quick feedback and letting me know. I'll close this for now as suggested.
(Removal of the attributes should also be configurable through the RTE YAML Processing directives though!)