Skip to content
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

[BUG] PHP Warning: Undefined array key "no_search_sub_entries" in typo3conf/ext/solr/Classes/IndexQueue/RecordMonitor.php line 203 #3401

Closed
LinkPool2 opened this issue Nov 10, 2022 · 2 comments

Comments

@LinkPool2
Copy link

Describe the bug
[BUG] PHP Warning: Undefined array key "no_search_sub_entries" in typo3conf/ext/solr/Classes/IndexQueue/RecordMonitor.php line 203

    protected function skipRecordByRootlineConfiguration(int $pid): bool
..
            if ($page['no_search_sub_entries']) {
..

should be?


    protected function skipRecordByRootlineConfiguration(int $pid): bool
    {
        /** @var RootlineUtility $rootlineUtility */
        $rootlineUtility = GeneralUtility::makeInstance(RootlineUtility::class, $pid);
        try {
            $rootline = $rootlineUtility->get();
        } catch (PageNotFoundException $e) {
            return true;
        }
        foreach ($rootline as $page) {
            if (isset($page['no_search_sub_entries']) && $page['no_search_sub_entries']) {
                return true;
            }
        }
        return false;
    }

@dkd-kaehm
Copy link
Collaborator

@LinkPool2
Thanks for reporting that issue.
Could you please provide a pull request and port for that?

Current state:

protected function skipRecordByRootlineConfiguration(int $pid): bool
{
/** @var RootlineUtility $rootlineUtility */
$rootlineUtility = GeneralUtility::makeInstance(RootlineUtility::class, $pid);
try {
$rootline = $rootlineUtility->get();
} catch (PageNotFoundException $e) {
return true;
}
foreach ($rootline as $page) {
if ($page['no_search_sub_entries']) {
return true;
}
}
return false;
}

MUST be changed to if ($page['no_search_sub_entries'] ?? false) { :

protected function skipRecordByRootlineConfiguration(int $pid): bool 
 { 
     /** @var RootlineUtility $rootlineUtility */ 
     $rootlineUtility = GeneralUtility::makeInstance(RootlineUtility::class, $pid); 
     try { 
         $rootline = $rootlineUtility->get(); 
     } catch (PageNotFoundException $e) { 
         return true; 
     } 
     foreach ($rootline as $page) { 
         if ($page['no_search_sub_entries'] ?? false) { 
             return true; 
         } 
     } 
     return false; 
 } 

Target versions:

  • release-11.5.x
  • main

@dkd-kaehm
Copy link
Collaborator

Fixed in #3381, #3438

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants