MediaAccessControlHandler JSON serialization fails in Drush

Created on 8 February 2022, almost 3 years ago
Updated 4 February 2023, almost 2 years ago

Problem/Motivation

Class throws error on serialization/deserialization which is required for Drush batch processing.

Unable to decode output into JSON: Syntax error

ParseError: syntax error, unexpected ')' in Composer\Autoload\includeFile() (line 50 of /var/www/my_website/web/core/modules/media/src/MediaAccessControlHandler.php).

After removing the comma, index process runs as expected.

Steps to reproduce

  1. Set up a Search API index
  2. Set up any content that contains a rendered Media entity
  3. Add content to index using Rendered HTML output field
  4. Run index through Drush using drush search-api:index

Proposed resolution

Remove extra comma from constructor.

Remaining tasks

Remove extra comma from constructor
I will post a patch shortly.

User interface changes

None

API changes

None

Data model changes

None

Release notes snippet

The class cannot be serialized with the extra comma in the constructor.
Removing this allows serialization and use in batch processing.

πŸ› Bug report
Status

Needs work

Version

9.5

Component
MediaΒ  β†’

Last updated 39 minutes ago

Created by

πŸ‡ΊπŸ‡ΈUnited States jimconte

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024