Skip to content

Symfony 8: Request::get() usage causes fatal error in PaginateElasticaQuerySubscriber #1988

@manhunt7

Description

@manhunt7

Using Symfony 8 causes a fatal error due to usage of the removed Request::get() method.

The issue occurs in:

FOS\ElasticaBundle\Subscriber\PaginateElasticaQuerySubscriber

Code:

return $request->get($key);

In Symfony 8, Request::get() has been removed, which results in:

"Attempted to call an undefined method named 'get' of class 'Symfony\Component\HttpFoundation\Request'"

Steps to reproduce:

  1. Install Symfony 8
  2. Install FOSElasticaBundle (7.1@dev)
  3. Use pagination with KnpPaginator + Elastica adapter
  4. Trigger pagination

Expected behavior:
Use $request->query->get($key) instead.

Actual behavior:
Fatal error due to undefined method Request::get()

Environment:

  • Symfony: 8.x
  • FOSElasticaBundle: 7.x-dev

Proposed fix:
Replace $request->get($key) with $request->query->get($key)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions