Breaking: Extended ContactRepository::findByPid() signature
Description
To support the new Show hidden records plugin option,
\FGTCLB\
changed one method:
find. The optional parameterBy Pid (int $pid, bool $show Hidden = false): Query Result Interface $showwas appended.Hidden
With
$show 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..
Impact
Calls of the repository keep working: the new parameter has a default value.
A class that extends
Contact and overrides
find
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\ and
override
find. 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);
}