Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function filterSet(Doctrine_Record $record, $name, $value)
public function filterGet(Doctrine_Record $record, $name)
{
$culture = sfDoctrineRecord::getDefaultCulture();
if (isset($record['Translation'][$culture]) && '' != $record['Translation'][$culture][$name])
if (is_subclass_of($record['Translation'][$culture], 'Doctrine_Record') && '' != $record['Translation'][$culture][$name])
Copy link
Contributor

@alquerci alquerci Apr 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My point of view.

We need to take gloves, as the test suite does not cover this part of the code.

Using is_subclass_of() is too much.
Indeed, it works.

This change forces the call on $record->get('Translation').
Which was not done on PHP 7+ but done on PHP 5, with the isset().
To dig deeper, read #184 (comment)


Also, the same bug has been fixed on doctine1 where there is a proof that works as it should.

{
return $record['Translation'][$culture][$name];
}
Expand Down