Skip to content

Category breaks the admin #2486

Description

@haivala

Environment

Sonata packages

show

$ composer show --latest 'sonata-project/*'
Direct dependencies required in composer.json:
sonata-project/admin-bundle              4.36.2 4.36.2 The missing Symfony Admin Generator
sonata-project/classification-bundle     4.9.1  4.9.1  Symfony SonataClassificationBundle
sonata-project/doctrine-orm-admin-bundle 4.18.0 4.18.0 Integrate Doctrine ORM into the SonataAdminBundle
sonata-project/entity-audit-bundle       1.19.0 1.19.0 Audit for Doctrine Entities
sonata-project/formatter-bundle          5.4.2  5.4.2  Symfony SonataFormatterBundle
sonata-project/media-bundle              4.16.0 4.16.0 Symfony SonataMediaBundle
sonata-project/page-bundle               4.9.0  4.9.0  This bundle provides a Site and Page management through container and block services
sonata-project/seo-bundle                3.8.1  3.8.1  Symfony SonataSeoBundle

Transitive dependencies not required in composer.json:
sonata-project/block-bundle              5.2.0  5.2.0  Symfony SonataBlockBundle
sonata-project/doctrine-extensions       2.5.0  2.5.0  Doctrine2 behavioral extensions
sonata-project/exporter                  3.3.1  3.3.1  Lightweight Exporter library
sonata-project/form-extensions           2.5.0  2.5.0  Symfony form extensions
sonata-project/twig-extensions           2.5.0  2.5.0  Sonata twig extensions

Symfony packages

show

$ composer show --latest 'symfony/*'
Direct dependencies required in composer.json:
symfony/asset-mapper               7.3.0  7.3.0  Maps directories of assets & makes them available in a public directory with versioned f...
symfony/console                    7.3.0  7.3.0  Eases the creation of beautiful and testable command line interfaces
symfony/debug-bundle               7.3.0  7.3.0  Provides a tight integration of the Symfony VarDumper component and the ServerLogCommand...
symfony/dotenv                     7.3.0  7.3.0  Registers environment variables from a .env file
symfony/flex                       2.7.1  2.7.1  Composer plugin for Symfony
symfony/framework-bundle           7.3.0  7.3.0  Provides a tight integration between Symfony components and the Symfony full-stack frame...
symfony/http-client                7.3.0  7.3.0  Provides powerful methods to fetch HTTP resources synchronously or asynchronously
symfony/mailer                     7.3.0  7.3.0  Helps sending emails
symfony/maker-bundle               1.63.0 1.63.0 Symfony Maker helps you create empty commands, controllers, form classes, tests and more...
symfony/monolog-bridge             7.3.0  7.3.0  Provides integration for Monolog with various Symfony components
symfony/monolog-bundle             3.10.0 3.10.0 Symfony MonologBundle
symfony/notifier                   7.3.0  7.3.0  Sends notifications via one or more channels (email, SMS, ...)
symfony/stimulus-bundle            2.25.2 2.25.2 Integration with your Symfony app & Stimulus!
symfony/stopwatch                  7.3.0  7.3.0  Provides a way to profile code
symfony/telegram-notifier          7.3.0  7.3.0  Symfony Telegram Notifier Bridge
symfony/ux-icons                   2.25.0 2.25.0 Renders local and remote SVG icons in your Twig templates.
symfony/ux-live-component          2.25.2 2.25.2 Live components for Symfony
symfony/ux-turbo                   2.25.2 2.25.2 Hotwire Turbo integration for Symfony
symfony/ux-twig-component          2.25.2 2.25.2 Twig components for Symfony
symfony/web-link                   7.3.0  7.3.0  Manages links between resources
symfony/web-profiler-bundle        7.3.0  7.3.0  Provides a development tool that gives detailed information about the execution of any r...
symfony/yaml                       7.3.0  7.3.0  Loads and dumps YAML files

Transitive dependencies not required in composer.json:
symfony/asset                      7.3.0  7.3.0  Manages URL generation and versioning of web assets such as CSS stylesheets, JavaScript ...
symfony/cache                      7.3.0  7.3.0  Provides extended PSR-6, PSR-16 (and tags) implementations
symfony/cache-contracts            3.6.0  3.6.0  Generic abstractions related to caching
symfony/clock                      7.3.0  7.3.0  Decouples applications from the system clock
symfony/config                     7.3.0  7.3.0  Helps you find, load, combine, autofill and validate configuration values of any kind
symfony/dependency-injection       7.3.0  7.3.0  Allows you to standardize and centralize the way objects are constructed in your applica...
symfony/deprecation-contracts      3.6.0  3.6.0  A generic function and convention to trigger deprecation notices
symfony/doctrine-bridge            7.3.0  7.3.0  Provides integration for Doctrine with various Symfony components
symfony/error-handler              7.3.0  7.3.0  Provides tools to manage errors and ease debugging PHP code
symfony/event-dispatcher           7.3.0  7.3.0  Provides tools that allow your application components to communicate with each other by ...
symfony/event-dispatcher-contracts 3.6.0  3.6.0  Generic abstractions related to dispatching event
symfony/expression-language        7.3.0  7.3.0  Provides an engine that can compile and evaluate expressions
symfony/filesystem                 7.3.0  7.3.0  Provides basic utilities for the filesystem
symfony/finder                     7.3.0  7.3.0  Finds files and directories via an intuitive fluent interface
symfony/form                       7.3.0  7.3.0  Allows to easily create, process and reuse HTML forms
symfony/http-client-contracts      3.6.0  3.6.0  Generic abstractions related to HTTP clients
symfony/http-foundation            7.3.0  7.3.0  Defines an object-oriented layer for the HTTP specification
symfony/http-kernel                7.3.0  7.3.0  Provides a structured process for converting a Request into a Response
symfony/intl                       7.3.0  7.3.0  Provides access to the localization data of the ICU library
symfony/mime                       7.3.0  7.3.0  Allows manipulating MIME messages
symfony/options-resolver           7.3.0  7.3.0  Provides an improved replacement for the array_replace PHP function
symfony/password-hasher            7.3.0  7.3.0  Provides password hashing utilities
symfony/polyfill-ctype             1.32.0 1.32.0 Symfony polyfill for ctype functions
symfony/polyfill-intl-grapheme     1.32.0 1.32.0 Symfony polyfill for intl's grapheme_* functions
symfony/polyfill-intl-icu          1.32.0 1.32.0 Symfony polyfill for intl's ICU-related data and classes
symfony/polyfill-intl-idn          1.32.0 1.32.0 Symfony polyfill for intl's idn_to_ascii and idn_to_utf8 functions
symfony/polyfill-intl-normalizer   1.32.0 1.32.0 Symfony polyfill for intl's Normalizer class and related functions
symfony/polyfill-mbstring          1.32.0 1.32.0 Symfony polyfill for the Mbstring extension
symfony/polyfill-php80             1.32.0 1.32.0 Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions
symfony/polyfill-php83             1.32.0 1.32.0 Symfony polyfill backporting some PHP 8.3+ features to lower PHP versions
symfony/polyfill-php84             1.32.0 1.32.0 Symfony polyfill backporting some PHP 8.4+ features to lower PHP versions
symfony/process                    7.3.0  7.3.0  Executes commands in sub-processes
symfony/property-access            7.3.0  7.3.0  Provides functions to read and write from/to an object or array using a simple string no...
symfony/property-info              7.3.0  7.3.0  Extracts information about PHP class' properties using metadata of popular sources
symfony/psr-http-message-bridge    7.3.0  7.3.0  PSR HTTP message bridge
symfony/routing                    7.3.0  7.3.0  Maps an HTTP request to a set of configuration variables
symfony/runtime                    7.3.0  7.3.0  Enables decoupling PHP applications from global state
symfony/security-acl               3.3.4  3.3.4  Symfony Security Component - ACL (Access Control List)
symfony/security-bundle            7.3.0  7.3.0  Provides a tight integration of the Security component into the Symfony full-stack frame...
symfony/security-core              7.3.0  7.3.0  Symfony Security Component - Core Library
symfony/security-csrf              7.3.0  7.3.0  Symfony Security Component - CSRF Library
symfony/security-http              7.3.0  7.3.0  Symfony Security Component - HTTP Integration
symfony/serializer                 7.3.0  7.3.0  Handles serializing and deserializing data structures, including object graphs, into arr...
symfony/service-contracts          3.6.0  3.6.0  Generic abstractions related to writing services
symfony/string                     7.3.0  7.3.0  Provides an object-oriented API to strings and deals with bytes, UTF-8 code points and g...
symfony/translation                7.3.0  7.3.0  Provides tools to internationalize your application
symfony/translation-contracts      3.6.0  3.6.0  Generic abstractions related to translation
symfony/twig-bridge                7.3.0  7.3.0  Provides integration for Twig with various Symfony components
symfony/twig-bundle                7.3.0  7.3.0  Provides a tight integration of Twig into the Symfony full-stack framework
symfony/type-info                  7.3.0  7.3.0  Extracts PHP types information.
symfony/validator                  7.3.0  7.3.0  Provides tools to validate values
symfony/var-dumper                 7.3.0  7.3.0  Provides mechanisms for walking through any arbitrary PHP variable
symfony/var-exporter               7.3.0  7.3.0  Allows exporting any serializable PHP data structure to plain PHP code

PHP version

$ php -v
PHP 8.4.7 (cli) (built: May  8 2025 21:27:24) (NTS)
Copyright (c) The PHP Group
Built by https://github.com/docker-library/php
Zend Engine v4.4.7, Copyright (c) Zend Technologies
    with Zend OPcache v8.4.7, Copyright (c), by Zend Technologies

Subject

Getting error: Input value "category" is invalid and flag "FILTER_NULL_ON_FAILURE" was not set.
I have force_disable_category: true in the config.

Steps to reproduce

  1. open media admin
  2. try to change the media context to something else than the default

Actual results

Symfony\Component\HttpFoundation\Exception\BadRequestException:
Input value "category" is invalid and flag "FILTER_NULL_ON_FAILURE" was not set.

  at vendor/symfony/http-foundation/InputBag.php:144
  at Symfony\Component\HttpFoundation\InputBag->filter('category', 0, 257, array('flags' => 167772160))
     (vendor/symfony/http-foundation/ParameterBag.php:153)
  at Symfony\Component\HttpFoundation\ParameterBag->getInt('category')
     (vendor/sonata-project/media-bundle/src/Controller/MediaAdminController.php:112)
  at Sonata\MediaBundle\Controller\MediaAdminController->listAction(object(SiteRequest))
     (vendor/symfony/http-kernel/HttpKernel.php:183)
  at Symfony\Component\HttpKernel\HttpKernel->handleRaw(object(SiteRequest), 1)
     (vendor/symfony/http-kernel/HttpKernel.php:76)
  at Symfony\Component\HttpKernel\HttpKernel->handle(object(SiteRequest), 1, true)
     (vendor/symfony/http-kernel/Kernel.php:182)
  at Symfony\Component\HttpKernel\Kernel->handle(object(SiteRequest))
     (vendor/symfony/runtime/Runner/Symfony/HttpKernelRunner.php:35)
  at Symfony\Component\Runtime\Runner\Symfony\HttpKernelRunner->run()
     (vendor/autoload_runtime.php:29)
  at require_once('/var/www/symfony/vendor/autoload_runtime.php')
     (public/index.php:5)        

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions