Image api assumes getPipeline method exists which breaks the image styles page

Created on 15 December 2022, over 1 year ago
Updated 30 November 2023, 7 months ago

Problem/Motivation

I am testing using the imgix module for some processing and had imageapi configured. After installing imgix I cannot visit the image style page due to:

The website encountered an unexpected error. Please try again later.
Error: Call to undefined method Drupal\imgix\Entity\ImgixImageStyle::getPipeline() in Drupal\imageapi_optimize\ImageStyleWithPipelineListBuilder->buildRow() (line 38 of modules/contrib/imageapi_optimize/src/ImageStyleWithPipelineListBuilder.php).

Drupal\imageapi_optimize\ImageStyleWithPipelineListBuilder->buildRow(Object) (Line: 219)
Drupal\Core\Entity\EntityListBuilder->render() (Line: 59)
Drupal\image\ImageStyleListBuilder->render() (Line: 23)
Drupal\Core\Entity\Controller\EntityListController->listing('image_style')
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 564)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 159)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 81)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 709)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

I'm not sure if this is an imgix implementation issue I can create an issue there if it is.

Steps to reproduce

Install imageapi and set up pipeline
I used tinypn
Install imgix module
Visit image style page

Proposed resolution

Check to see if getPipeline method exists.

I did a quick test to check for the method in ImageStyleWithPipelineListBuilder.php

$pipeline = '';
    if (method_exists($entity, 'getPipeline')) {
      $pipeline = isset($pipelineNames[$entity->getPipeline()]) ? $pipelineNames[$entity->getPipeline()] : '';
    }

    $row['pipeline'] = $pipeline;

I'm not providing a patch / merge request cause that made the page load but it wiped all of the previously configured pipelines.

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Needs work

Version

4.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States nicxvan

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

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.69.0 2024