- Issue created by @sidgrafix
- π¨πΏCzech Republic kryber
Hello, I am having the same problem. Trying to use media-thumbnails and having the right binary files in place, the only appearing problem is this.
Deprecated function: Return type of Alchemy\BinaryDriver\Configuration::offsetUnset($offset) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice ve funkci include() (ΕΓ‘dek 14 souboru /app/docroot/vendor/alchemy/binary-driver/src/Alchemy/BinaryDriver/Configuration.php) #0 /app/docroot/core/includes/bootstrap.inc(347): _drupal_error_handler_real(8192, 'Return type of ...', '/app/docroot/ve...', 103) #1 /app/docroot/vendor/alchemy/binary-driver/src/Alchemy/BinaryDriver/Configuration.php(14): _drupal_error_handler(8192, 'Return type of ...', '/app/docroot/ve...', 103) #2 /app/docroot/vendor/composer/ClassLoader.php(578): include('/app/docroot/ve...') #3 /app/docroot/vendor/composer/ClassLoader.php(432): Composer\Autoload\ClassLoader::Composer\Autoload\{closure}('/app/docroot/ve...') #4 /app/docroot/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/Driver/FFProbeDriver.php(42): Composer\Autoload\ClassLoader->loadClass('Alchemy\\BinaryD...') #5 /app/docroot/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/FFProbe.php(226): FFMpeg\Driver\FFProbeDriver::create(Array, NULL) #6 /app/docroot/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/FFMpeg.php(132): FFMpeg\FFProbe::create(Array, NULL, Object(Symfony\Component\Cache\Adapter\ArrayAdapter)) #7 /app/docroot/modules/contrib/media_thumbnails_video/src/Plugin/MediaThumbnail/MediaThumbnailVideo.php(39): FFMpeg\FFMpeg::create(Array) #8 /app/docroot/modules/contrib/media_thumbnails/src/Plugin/MediaThumbnailManager.php(103): Drupal\media_thumbnails_video\Plugin\MediaThumbnail\MediaThumbnailVideo->createThumbnail('public://2023-0...') #9 /app/docroot/modules/contrib/media_thumbnails/src/Plugin/MediaThumbnailManager.php(119): Drupal\media_thumbnails\Plugin\MediaThumbnailManager->createThumbnail(Object(Drupal\media\Entity\Media)) #10 /app/docroot/modules/contrib/media_thumbnails/media_thumbnails.module(36): Drupal\media_thumbnails\Plugin\MediaThumbnailManager->updateThumbnail(Object(Drupal\media\Entity\Media)) #11 [internal function]: media_thumbnails_media_presave(Object(Drupal\media\Entity\Media)) #12 /app/docroot/core/lib/Drupal/Core/Extension/ModuleHandler.php(426): call_user_func_array(Object(Closure), Array) #13 /app/docroot/core/lib/Drupal/Core/Extension/ModuleHandler.php(405): Drupal\Core\Extension\ModuleHandler->Drupal\Core\Extension\{closure}(Object(Closure), 'media_thumbnail...') #14 /app/docroot/core/lib/Drupal/Core/Extension/ModuleHandler.php(433): Drupal\Core\Extension\ModuleHandler->invokeAllWith('media_presave', Object(Closure)) #15 /app/docroot/core/lib/Drupal/Core/Entity/EntityStorageBase.php(249): Drupal\Core\Extension\ModuleHandler->invokeAll('media_presave', Array) #16 /app/docroot/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php(903): Drupal\Core\Entity\EntityStorageBase->invokeHook('presave', Object(Drupal\media\Entity\Media)) #17 /app/docroot/core/lib/Drupal/Core/Entity/EntityStorageBase.php(563): Drupal\Core\Entity\ContentEntityStorageBase->invokeHook('presave', Object(Drupal\media\Entity\Media)) #18 /app/docroot/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php(756): Drupal\Core\Entity\EntityStorageBase->doPreSave(Object(Drupal\media\Entity\Media)) #19 /app/docroot/core/lib/Drupal/Core/Entity/EntityStorageBase.php(517): Drupal\Core\Entity\ContentEntityStorageBase->doPreSave(Object(Drupal\media\Entity\Media)) #20 /app/docroot/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php(804): Drupal\Core\Entity\EntityStorageBase->save(Object(Drupal\media\Entity\Media)) #21 /app/docroot/core/modules/media/src/MediaStorage.php(29): Drupal\Core\Entity\Sql\SqlContentEntityStorage->save(Object(Drupal\media\Entity\Media)) #22 /app/docroot/core/lib/Drupal/Core/Entity/EntityBase.php(339): Drupal\media\MediaStorage->save(Object(Drupal\media\Entity\Media)) #23 /app/docroot/modules/contrib/media_thumbnails/src/Batch/RefreshBatch.php(72): Drupal\Core\Entity\EntityBase->save() #24 /app/docroot/core/includes/batch.inc(295): Drupal\media_thumbnails\Batch\RefreshBatch::process(Array, Array) #25 /app/docroot/core/includes/batch.inc(137): _batch_process() #26 /app/docroot/core/includes/batch.inc(93): _batch_do() #27 /app/docroot/core/modules/system/src/Controller/BatchController.php(55): _batch_page(Object(Symfony\Component\HttpFoundation\Request)) #28 [internal function]: Drupal\system\Controller\BatchController->batchPage(Object(Symfony\Component\HttpFoundation\Request)) #29 /app/docroot/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array(Array, Array) #30 /app/docroot/core/lib/Drupal/Core/Render/Renderer.php(580): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() #31 /app/docroot/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure)) #32 /app/docroot/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) #33 /app/docroot/vendor/symfony/http-kernel/HttpKernel.php(169): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() #34 /app/docroot/vendor/symfony/http-kernel/HttpKernel.php(81): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1) #35 /app/docroot/core/lib/Drupal/Core/StackMiddleware/Session.php(58): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #36 /app/docroot/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #37 /app/docroot/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #38 /app/docroot/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true) #39 /app/docroot/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #40 /app/docroot/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #41 /app/docroot/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #42 /app/docroot/core/lib/Drupal/Core/DrupalKernel.php(713): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #43 /app/docroot/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request)) #44 {main} .
- π¨πΏCzech Republic kryber
Seems like there is a problem: https://php.watch/versions/8.1/internal-method-return-types
- π¨πΏCzech Republic kryber
I corrected it by adding a #[\ReturnTypeWillChange] before all the functions in a file vendor/alchemy/binary-driver/src/Alchemy/BinaryDriver/Configuration.php.
<?php /* * This file is part of Alchemy\BinaryDriver. * * (c) Alchemy <info@alchemy.fr> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Alchemy\BinaryDriver; class Configuration implements ConfigurationInterface { private $data; #[\ReturnTypeWillChange] public function __construct(array $data = array()) { $this->data = $data; } /** * {@inheritdoc} */ #[\ReturnTypeWillChange] public function getIterator() { return new \ArrayIterator($this->data); } /** * {@inheritdoc} */ #[\ReturnTypeWillChange] public function get($key, $default = null) { return isset($this->data[$key]) ? $this->data[$key] : $default; } /** * {@inheritdoc} */ #[\ReturnTypeWillChange] public function set($key, $value) { $this->data[$key] = $value; return $this; } /** * {@inheritdoc} */ #[\ReturnTypeWillChange] public function has($key) { return array_key_exists($key, $this->data); } /** * {@inheritdoc} */ #[\ReturnTypeWillChange] public function remove($key) { $value = $this->get($key); unset($this->data[$key]); return $value; } /** * {@inheritdoc} */ #[\ReturnTypeWillChange] public function all() { return $this->data; } /** * {@inheritdoc} */ #[\ReturnTypeWillChange] public function offsetExists($offset) { return $this->has($offset); } /** * {@inheritdoc} */ #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->get($offset); } /** * {@inheritdoc} */ #[\ReturnTypeWillChange] public function offsetSet($offset, $value) { $this->set($offset, $value); } /** * {@inheritdoc} */ #[\ReturnTypeWillChange] public function offsetUnset($offset) { $this->remove($offset); } }
- πΊπΈUnited States sidgrafix
@kryber
Nice.. I will try this myself when I'm back in the office! Did you test for thumbnails yet, do they generate after this modification to vendor/alchemy/binary-driver/src/Alchemy/BinaryDriver/Configuration.php ?
- π¨πΏCzech Republic kryber
Yes, absolutely! They are nice and smooth :)
The other part was to connect the right libraries for the server. On my local mac machine I needed to use the linux64. https://ffbinaries.com/downloads
- πΊπΈUnited States sidgrafix
@kryber
Tested and works! Thank you for this...
Now I just have to get actual video transcoding working, but this takes care of some of the thumbnail part of the battle. Seems both "Local Video Thumbnail and Media Thumbnails with Media Thumbnails Video" are still fairly limited providing just 1 thumbnail - multiple with options to choose which one in a video situation would be nice (when video is uploaded instead of when saved) but this gives me something to build on.Most appreciative!
- π¦π·Argentina foxrip
#4 works well for me.
I added the patch, just in case someone want to use it. - πͺπΈSpain saesa
@foxrip the patch doesn't work for me wit drupal 9.5.3 and php_ffmpeg 8.x-1.1
Could not apply patch! Skipping. The error was: Cannot apply patch https://www.drupal.org/files/issues/2023-03-15/3340962-deprecated-function-alchemy.patch
- Status changed to Needs review
over 1 year ago 7:43am 20 April 2023 - Status changed to Closed: won't fix
11 months ago 10:47am 22 December 2023 - π¨πSwitzerland berdir Switzerland
Those errors happen in a dependency of our dependency, you need to report it there, not in this project. I added a note to the project page, but this isn't something we can fix.