Problem/Motivation

When using the version 2.0-alpha1 of focal_point module, we are receiving an error when creating a Document media.

Steps to reproduce

1. Go to /media/add/document
2. Upload a PDF file
3. Click on "Save"
4. The following exception will be thrown:
`TypeError: Drupal\focal_point\FocalPointManager::saveCropEntity(): Argument #3 ($width) must be of type int, null given, called in /var/www/web/modules/contrib/focal_point/focal_point.module on line 99 in Drupal\focal_point\FocalPointManager->saveCropEntity() (line 94 of /var/www/web/modules/contrib/focal_point/src/FocalPointManager.php)`

Proposed resolution

The function `saveCropEntity` has typed parameters in 2.0 version however, there is no width or height for the Documents thumbnail. We should allow nullable values for these parameters.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

hfernandes created an issue. See original summary.

hfernandes’s picture

Status: Active » Needs review
StatusFileSize
new1.09 KB

Patch attached

Arti Anil Pattewar’s picture

Not able to reproduce the issue.
installed focal point. cloned 2.0 from version control, installed all the dependency modules.

ankitv18 made their first commit to this issue’s fork.

ankitv18’s picture

Assigned: hfernandes » Unassigned
Status: Needs review » Reviewed & tested by the community
StatusFileSize
new473.3 KB
new584.47 KB

Hi,
This issue is already covered in https://www.drupal.org/project/focal_point/issues/3295940.
We are good to close this one.

rajeshreeputra’s picture

Status: Reviewed & tested by the community » Fixed

Thanks for confirming, Closing.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.