MediaAccessControlHandler JSON serialization fails in Drush

Created on 8 February 2022, over 2 years ago
Updated 4 February 2023, over 1 year 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 about 17 hours 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.

  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    This issue is being reviewed by the kind folks in Slack, #needs-review-queue-initiative. We are working to keep the size of Needs Review queue [2700+ issues] to around 400 (1 month or less), following Review a patch or merge request β†’ as a guide.

    Not following how that solves the issue?

    This will need a test case to show the issue.

Production build 0.71.5 2024