TYPO3-Solr / ext-solr

A TYPO3 extension that integrates the Apache Solr search server with TYPO3 CMS. dkd Internet Service GmbH is developing the extension. Community contributions are welcome. See CONTRIBUTING.md for details.
GNU General Public License v3.0
136 stars 246 forks source link

[BUG] PHP Warning: Argument 1 passed to SchemaParser::parseJson() must be of the type string, null given #3402

Open SSFGizmo opened 1 year ago

SSFGizmo commented 1 year ago
(1/1) TypeError

Argument 1 passed to ApacheSolrForTypo3\Solr\System\Solr\Parser\SchemaParser::parseJson() must be of the type string, null given,
called in /solr/Classes/System/Solr/Service/SolrAdminService.php on line 274

To Reproduce Steps to reproduce the behavior:

Used versions (please complete the following information):

dkd-kaehm commented 1 year ago

@SSFGizmo Thanks for the reporting this issue.

Why you are not using the GitHub-Issue template as is? https://github.com/TYPO3-Solr/ext-solr/issues/new?assignees=&labels=&template=bug_report.md&title=%5BBUG%5D+Please+add+a+speaking+title

With "Container is offline" and "Click on 'Core Optimization'", you mean the steps to reproduce?

SSFGizmo commented 1 year ago

@dkd-kaehm Sorry, I removed too many lines from this template.

With "Container is offline" and "Click on 'Core Optimization'", you mean the steps to reproduce?

yes

SSFGizmo commented 1 year ago

maybe it's enough to add

?? ''

/solr/Classes/System/Solr/Service/SolrAdminService.php

public function getSchema(): Schema
...
   $this->schema = $this->schemaParser->parseJson($response->getRawResponse() ?? '');

public function getSynonyms(string $baseWord = ''): array
...
   return $this->synonymParser->parseJson($baseWord, $response->getRawResponse() ?? '');

public function getStopWords(): array
...
    return $this->stopWordParser->parseJson($response->getRawResponse() ?? '');
dkd-kaehm commented 1 year ago

IMHO, The right exception should be thrown before that all kicks in. The $response must be valid.

@dkd-friedrich did a Changes to exceptions handling. It would be nice to handle those troubles in proper way as well.

dkd-friedrich commented 1 year ago

The right exception should be thrown before that all kicks in.

I agree, we should handle the cause of this issues.

@dkd-friedrich did a Changes to exceptions handling. It would be nice to handle those troubles in proper way as well.

Extensions are unfortunately not yet complete and contain breaking changes in the current form.

The plan is to use more specific exceptions, which are based on an EXT:solr base exception. I will try to provide the base exception soon, so we can use this here.

SSFGizmo commented 1 year ago

thx