Breaking: Extended ContactRepository::findByPid() signature 

Description 

To support the new Show hidden records plugin option, \FGTCLB\AcademicContacts4pages\Domain\Repository\ContactRepository changed one method:

  • findByPid(int $pid, bool $showHidden = false): QueryResultInterface . The optional parameter $showHidden was appended.

With $showHidden set to true , the query ignores only the hidden flag of the contacts. Deleted records, start and end time and frontend user groups still apply. The contacts content element passes its settings.showHiddenRecords .

Impact 

Calls of the repository keep working: the new parameter has a default value.

A class that extends ContactRepository and overrides findByPid() with the old signature fails with a PHP fatal error, because the method of the subclass no longer accepts every parameter of the parent method.

Affected Installations 

Installations that extend \FGTCLB\AcademicContacts4pages\Domain\Repository\ContactRepository and override findByPid() . All other installations are unaffected.

Migration 

Add the parameter to the overriding method and pass it on:

public function findByPid(int $pid, bool $showHidden = false): QueryResultInterface
{
    // ...
    return parent::findByPid($pid, $showHidden);
}
Copied!