Getting error on media edit/add page after setting Image widget to Image (Focal Point)

Created on 12 July 2024, 6 months ago
Updated 16 July 2024, 6 months ago

Problem/Motivation

Not able to edit existing images/ add new image when Image(Focal Point) is selected as Image widget. The error says " The website encountered an unexpected error. Try again later."
I checked in admin/Reports/Recent log messages and found a php error while editing existing image:
Drupal\Core\Database\DatabaseExceptionWrapper: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'db.crop_field_data' doesn't exist: SELECT "cfd"."type" AS "type", "cfd"."cid" AS "cid" FROM "crop_field_data" "cfd" WHERE "cfd"."uri" = :db_condition_placeholder_0; Array ( [:db_condition_placeholder_0] => public://2024-07/about-benefits-back-FNL-2_0.jpg ) in Drupal\crop\CropStorage->getCrop() (line 41 of /var/www/html/modules/contrib/crop/src/CropStorage.php).

While adding new image:
Drupal\Core\Entity\EntityStorageException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'db.crop' doesn't exist: SELECT "base_table"."vid" AS "vid", "base_table"."cid" AS "cid" FROM "crop" "base_table" INNER JOIN "crop_field_data" "crop_field_data" ON "crop_field_data"."cid" = "base_table"."cid" WHERE "crop_field_data"."uri" LIKE :db_condition_placeholder_0 ESCAPE '\\'; Array ( [:db_condition_placeholder_0] => public://2024-07/mina-guli-weight-water-hero\_1.jpeg ) in Drupal\Core\Entity\Sql\SqlContentEntityStorage->save() (line 817 of /var/www/html/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php).

I'm not sure if this is related to Crop API module. But raising it here as this occurs while setting Image(Focal Point) widget.

Steps to reproduce

  1. Install Focal Point and Crop API module
  2. Go to admin/structure/media types/Image/Manage form display.
  3. Select Image(Focal Point) as widget for the Image field and save the changes
  4. Go to media library and edit an existing image. It is throwing error.
  5. Similarly try adding a new image. Same error occurs.

Proposed resolution

Remaining tasks

Fix required

🐛 Bug report
Status

Active

Version

2.0

Component

Other Code

Created by

🇮🇳India nayana_mvr

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

Comments & Activities

Production build 0.71.5 2024