- π¬π§United Kingdom andreastkdf
Updating patch to fix issue with NULL
$thumbnail_url
:Deprecated function: file_get_contents(): Passing null to parameter #1 ($filename) of type string is deprecated in Drupal\media\OEmbed\Resource::rich() (line 312 of /var/www/html/web/core/modules/media/src/OEmbed/Resource.php)
- Status changed to Needs review
over 1 year ago 6:51am 14 July 2023 - last update
over 1 year ago 30,341 pass - πΊπ¦Ukraine id.conky UA, Lutsk
Improved patch a bit - moved logic to resource fetcher which will do thumbnail dimensions processing at the oembed API call to source and data parsing. This will allow us to use resources much more efficient, as this data will be cached.
In case we keep following code in Resource class it will multiple times do same job - download thumbnails and parse it's width/height.
Also I found issue in prev patch - when there are thumbnail width, height and url available - it will set $thumbnail_url to NULL which will broke everything and no thumbnails will be generated at all.
- Status changed to Needs work
over 1 year ago 5:45pm 14 July 2023 - πΊπΈUnited States smustgrave
As a bug will need a test case showing the issue. Also may want to write it for 11.x as it will have to land there first to be backported.
- Merge request !9470[10.3.x-only-DO-NOT-MERGE]: #3331771 Fix file_get_contents(): Passing null to parameter β (Open) created by andreastkdf
- π¬π§United Kingdom andreastkdf
andreastkdf β changed the visibility of the branch 3331771-oembed-fails-to to hidden.
- Merge request !9471[10.3.x-only-DO-NOT-MERGE]: #3331771 fix file_get_contents error β (Closed) created by andreastkdf
- π¬π§United Kingdom andreastkdf
added a new MR for 10.3.x but agree about this needing to be rerolled for 11.x
The MR9471 basically contain both #6 π OEmbed fails to save if thumbnail fails to download Needs work and #7 π OEmbed fails to save if thumbnail fails to download Needs work . A note about #7 π OEmbed fails to save if thumbnail fails to download Needs work : RessourceFetcher calls createResource which calls Resource:rich too, so the fix on #6 π OEmbed fails to save if thumbnail fails to download Needs work is needed to fix the
ValueError: Path cannot be empty in file_get_contents()
error. - First commit to issue fork.
- π¬π§United Kingdom andreastkdf
andreastkdf β changed the visibility of the branch 333177 to active.
- Merge request !10035[10.3.x-only-DO-NOT-MERGE]: #3331771 fix file_get_contents error β (Open) created by andreastkdf
- π¬π§United Kingdom andreastkdf
added a new MR to re-roll for 10.3.x (this still needs to be rerolled for 11.x)