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

Fix fatal error in DownloadController #3154

Merged
merged 1 commit into from
Dec 22, 2023
Merged
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 @@ -63,7 +63,7 @@ public function downloadBinaryFileByIdAction(Request $request, int $contentId, i
protected function findFieldInContent(int $fieldId, Content $content): Field
{
foreach ($content->getFields() as $field) {
if ($field->getId() === $fieldId) {
if ($field->id === $fieldId) {
Copy link
Member

Choose a reason for hiding this comment

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

Normally I would request to add missing getId method, but given this is unmaintained 2.5 fix and it can go into 2.5 only, I'll allow it. Magic is bad because of performance (from 0.2s to 5s when it's scaled to e.g 30 000 calls, which is not uncommon on simple properties).
Here we can leave it as-is.

return $field;
}
}
Expand Down
Loading