Bug #89816

error in linkPage generation

Added by david no-lastname-given 11 months ago. Updated 7 months ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Indexed Search
Target version:
-
Start date:
2019-12-01
Due date:
% Done:

100%

TYPO3 Version:
9
PHP Version:
7.2
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

I get sometimes an error in searchcontroller in function linkPage.

first i get two warnings:
Core: Error handler (FE): PHP Warning: array_replace_recursive(): Argument #2 is not an array in /sysext/indexed_search/Classes/Controller/SearchController.php line 1335
Core: Error handler (FE): PHP Warning: array_merge(): Argument #1 is not an array in //sysext/indexed_search/Classes/Controller/SearchController.php line 1345

then an error:
Core: Exception handler (WEB): Uncaught TYPO3 Exception: Argument 3 passed to TYPO3\CMS\IndexedSearch\Controller\SearchController::preparePageLink() must be of the type array, null given, called in /sysext/indexed_search/Classes/Controller/SearchController.php on line 1352

In my project sometimes "null" is stored for "static_page_arguments" in the database. Most other records are stored with "". I think this happens with option "Index Records immediately when saved?"

if ($row['static_page_arguments'] !== null --> is not working.
if ($row['static_page_arguments'] !== null && $row['static_page_arguments'] != 'null') { --> works for me

Associated revisions

Revision 05bf35d7 (diff)
Added by Manuel Munz 8 months ago

[BUGFIX] Fix Exception caused by empty staticPageArguments

When 'Index Records immediately when saved?' is enabled in indexing
configurations for records, then on saving the record the
string 'null' is used for this indexingconfiguration and passed to
SearchController::preparePageLink(), which expects an array and
therefore throws an exception.

This commit fixes this by checking if
$this->conf['staticPageArguments'] is an array and only then json_decode
that, else it sets the value to null.

Resolves: #89816
Related: #86994
Releases: master, 9.5
Change-Id: I96d3fb963ecb508bc536967afece064ad12bb989
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/63414
Tested-by: TYPO3com <>
Tested-by: Benni Mack <>
Tested-by: Georg Ringer <>
Reviewed-by: Benni Mack <>
Reviewed-by: Georg Ringer <>

Revision dd9be5a9 (diff)
Added by Manuel Munz 8 months ago

[BUGFIX] Fix Exception caused by empty staticPageArguments

When 'Index Records immediately when saved?' is enabled in indexing
configurations for records, then on saving the record the
string 'null' is used for this indexingconfiguration and passed to
SearchController::preparePageLink(), which expects an array and
therefore throws an exception.

This commit fixes this by checking if
$this->conf['staticPageArguments'] is an array and only then json_decode
that, else it sets the value to null.

Resolves: #89816
Related: #86994
Releases: master, 9.5
Change-Id: I96d3fb963ecb508bc536967afece064ad12bb989
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/63414
Tested-by: TYPO3com <noreply@typo3.com>
Tested-by: Benni Mack <benni@typo3.org>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
Reviewed-by: Benni Mack <benni@typo3.org>
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/63448

History

#1 Updated by Gerrit Code Review 8 months ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/63414

#2 Updated by Anonymous 8 months ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

#3 Updated by Gerrit Code Review 8 months ago

  • Status changed from Resolved to Under Review

Patch set 1 for branch 9.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/63448

#4 Updated by Anonymous 8 months ago

  • Status changed from Under Review to Resolved

#5 Updated by Benni Mack 7 months ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF