tomasnorre/crawler

Unwanted PHP warning for failed unserialize

ulrichmathes opened this issue · 5 comments

Bug Report

Current Behavior
JsonCompatibilityConverter:53 rises PHP warning

Expected behavior/output
When JsonCompatibilityConverter tries to unserialize a string and fails, there should be no warning.
There is a try catch block, but unserialize emits a warning instead of throwing an exception.

Steps to reproduce
I think JsonCompatibilityConverterTest will rise this warning but unitTests are configured as failOnWarning="false".

Environment

  • Crawler version(s): 12.0.4
  • TYPO3 version(s): 12.4
  • PHP version(s): 8.3
  • Is your TYPO3 installation set up with Composer (Composer Mode): yes

Possible Solution
suppress the warning via @unserialize instead of not applying try catch?

Additional context
This issue is caused by the change in PHP 8.3:

8.3.0 Now emits E_WARNING when the passed string is not unserializeable; previously E_NOTICE was emitted.

Hi there, thank you for taking your time to create your first issue. Please give us a bit of time to review it.

This looks like it could be related to #1087, do you agree?

Same root but in my case both commands crawler:buildQueue and crawler:processQueue proceed running while generating a lot of warnings.

But yes, we could close this issue as its not really relevant if the command is running but rising warnings or gets terminated after the first warning.

I'll close this issue as @ulrichmathes suggested.