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.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | Screenshot 2022-12-16 at 9.09.39 PM.png | 584.47 KB | ankitv18 |
| #5 | Screenshot 2022-12-16 at 9.09.25 PM.png | 473.3 KB | ankitv18 |
| #3 | Screenshot 2022-11-23 at 12.04.30 PM.png | 835.57 KB | Arti Anil Pattewar |
| #3 | Screenshot 2022-11-23 at 12.04.22 PM.png | 846.97 KB | Arti Anil Pattewar |
| #3 | Screenshot 2022-11-23 at 12.04.13 PM.png | 851.91 KB | Arti Anil Pattewar |
Issue fork focal_point-3323205
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
Comment #2
hfernandes commentedPatch attached
Comment #3
Arti Anil Pattewar commentedNot able to reproduce the issue.
installed focal point. cloned 2.0 from version control, installed all the dependency modules.
Comment #5
ankitv18 commentedHi,
This issue is already covered in https://www.drupal.org/project/focal_point/issues/3295940.
We are good to close this one.
Comment #6
rajeshreeputraThanks for confirming, Closing.