Neu OPC Vimeo Video funktioniert nicht

cashregisterstore

Sehr aktives Mitglied
29. September 2012
310
44
Leider lässt sich kein Vimeo Video mehr per OPC hinzufügen, der Shop speichert stets Youtube, es wird dann das Standard Video von JTL angezeigt,

Bei bereits vorhandenen eingebundenen Vimeo Videos wird eine 500er Meldung für die Seite ausgegeben.
 

OliverS

Gut bekanntes Mitglied
Mitarbeiter
1. April 2022
89
46
Hückelhoven
Leider lässt sich kein Vimeo Video mehr per OPC hinzufügen, der Shop speichert stets Youtube, es wird dann das Standard Video von JTL angezeigt,

Bei bereits vorhandenen eingebundenen Vimeo Videos wird eine 500er Meldung für die Seite ausgegeben.
Ich hab grad vor 5 Minuten noch getestet, ein Vimeo-Video per Video-Portlet über den OPC einzubinden und das hat problemlos geklappt. Sowohl 722256136 als auch 141374353...
 

aft2d

Neues Mitglied
4. Oktober 2024
1
0
Ich kann das Problem bestätigen.

Beim API-Call von JTL- Shop zu Vimeo gibt Vimeo ein 403 Error zurück. file_get_contents gibt dadurch false an json_decode was eine Exception verursacht. Das Video kann ebenfalls nicht im OPC Editor entfernt werden, da dieser auch durch einen 500 vom Shop am laden gehindert wird.

Ein cURL request an die selbe Vimeo URL funktioniert. Wir haben auch zwei Shops in der selben Version auf dem selben Server laufen. Aber nur einer der beiden hat das Problem, obwohl beide das selbe Video laden.

Code:
[Fri Oct 04 15:57:13.307025 2024] stderr: PHP Warning:  file_get_contents(https://vimeo.com/api/v2/video/*********.json): Failed to open stream: HTTP request failed! HTTP/1.1 403 Forbidden, referer: https://***.com/
[Fri Oct 04 15:57:13.307039 2024] stderr:  in /var/www/vhosts/shop1/includes/src/OPC/Portlets/Video/Video.php on line 32, referer: https://***.com/
[Fri Oct 04 15:57:13.307226 2024] stderr: PHP Fatal error:  Uncaught TypeError: json_decode(): Argument #1 ($json) must be of type string, bool given in /var/www/vhosts/shop1/includes/src/OPC/Portlets/Video/Video.php:32, referer: https://***.com/
[Fri Oct 04 15:57:13.307249 2024] stderr: Stack trace:, referer: https://***.com/
[Fri Oct 04 15:57:13.307261 2024] stderr: #0 /var/www/vhosts/shop1/includes/src/OPC/Portlets/Video/Video.php(32): json_decode(), referer: https://***.com/
[Fri Oct 04 15:57:13.307280 2024] stderr: #1 /var/www/vhosts/shop1/templates_c/NOVA/c056063fb64b6d921ac7cb11cfc9313be67f4188_0.file.Video.tpl.php(61): JTL\\OPC\\Portlets\\Video\\Video->getPreviewImageUrl(), referer: https://***.com/
[Fri Oct 04 15:57:13.307299 2024] stderr: #2 /var/www/vhosts/shop1/includes/vendor/smarty/smarty/libs/sysplugins/smarty_template_resource_base.php(123): content_66ffeee4753f68_24591957(), referer: https://***.com/
[Fri Oct 04 15:57:13.307312 2024] stderr: #3 /var/www/vhosts/shop1/includes/vendor/smarty/smarty/libs/sysplugins/smarty_template_compiled.php(114): Smarty_Template_Resource_Base->getRenderedTemplateCode(), referer: https://***.com/
[Fri Oct 04 15:57:13.307326 2024] stderr: #4 /var/www/vhosts/shop1/includes/vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php(217): Smarty_Template_Compiled->render(), referer: https://***.com/
[Fri Oct 04 15:57:13.307345 2024] stderr: #5 /var/www/vhosts/shop1/includes/src/Smarty/JTLSmartyTemplateClass.php(59): Smarty_Internal_Template->render(), referer: https://***.com/
[Fri Oct 04 15:57:13.307381 2024] stderr: #6 /var/www/vhosts/shop1/includes/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php(238): JTL\\Smarty\\JTLSmartyTemplateClass->render(), referer: https://***.com/
[Fri Oct 04 15:57:13.307396 2024] stderr: #7 /var/www/vhosts/shop1/includes/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php(116): Smarty_Internal_TemplateBase->_execute(), referer: https://***.com/
[Fri Oct 04 15:57:13.307410 2024] stderr: #8 /var/www/vhosts/shop1/includes/src/Smarty/JTLSmarty.php(311): Smarty_Internal_TemplateBase->fetch(), referer: https://***.com/
[Fri Oct 04 15:57:13.307423 2024] stderr: #9 /var/www/vhosts/shop1/includes/src/OPC/PortletHtml.php(141): JTL\\Smarty\\JTLSmarty->fetch(), referer: https://***.com/
[Fri Oct 04 15:57:13.307436 2024] stderr: #10 /var/www/vhosts/shop1/includes/src/OPC/PortletHtml.php(117): JTL\\OPC\\Portlet->getHtmlFromTpl(), referer: https://***.com/
[Fri Oct 04 15:57:13.307450 2024] stderr: #11 /var/www/vhosts/shop1/includes/src/OPC/PortletHtml.php(33): JTL\\OPC\\Portlet->getFinalHtmlFromTpl(), referer: https://***.com/
[Fri Oct 04 15:57:13.307463 2024] stderr: #12 /var/www/vhosts/shop1/includes/src/OPC/PortletInstance.php(125): JTL\\OPC\\Portlet->getFinalHtml(), referer: https://***.com/
[Fri Oct 04 15:57:13.307476 2024] stderr: #13 /var/www/vhosts/shop1/includes/src/OPC/Area.php(86): JTL\\OPC\\PortletInstance->getFinalHtml(), referer: https://***.com/
[Fri Oct 04 15:57:13.307489 2024] stderr: #14 /var/www/vhosts/shop1/includes/src/OPC/PortletInstance.php(162): JTL\\OPC\\Area->getFinalHtml(), referer: https://***.com/
[Fri Oct 04 15:57:13.307503 2024] stderr: #15 /var/www/vhosts/shop1/templates_c/NOVA/9b194f61c88f157a93e3f2eb78ae084dbac44add_0.file.Row.tpl.php(63): JTL\\OPC\\PortletInstance->getSubareaFinalHtml(), referer: https://***.com/
[Fri Oct 04 15:57:13.307518 2024] stderr: #16 /var/www/vhosts/shop1/includes/vendor/smarty/smarty/libs/sysplugins/smarty_template_resource_base.php(123): content_66ffeee46bda57_15127021(), referer: https://***.com/
[Fri Oct 04 15:57:13.307540 2024] stderr: #17 /var/www/vhosts/shop1/includes/vendor/smarty/smarty/libs/sysplugins/smarty_template_compiled.php(114): Smarty_Template_Resource_Base->getRenderedTemplateCode(), referer: https://***.com/
[Fri Oct 04 15:57:13.307554 2024] stderr: #18 /var/www/vhosts/shop1/includes/vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php(217): Smarty_Template_Compiled->render(), referer: https://***.com/
[Fri Oct 04 15:57:13.307577 2024] stderr: #19 /var/www/vhosts/shop1/includes/src/Smarty/JTLSmartyTemplateClass.php(59): Smarty_Internal_Template->render(), referer: https://***.com/
[Fri Oct 04 15:57:13.307591 2024] stderr: #20 /var/www/vhosts/shop1/includes/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php(238): JTL\\Smarty\\JTLSmartyTemplateClass->render(), referer: https://***.com/
[Fri Oct 04 15:57:13.307605 2024] stderr: #21 /var/www/vhosts/shop1/includes/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php(116): Smarty_Internal_TemplateBase->_execute(), referer: https://***.com/
[Fri Oct 04 15:57:13.307618 2024] stderr: #22 /var/www/vhosts/shop1/includes/src/Smarty/JTLSmarty.php(311): Smarty_Internal_TemplateBase->fetch(), referer: https://***.com/
[Fri Oct 04 15:57:13.307632 2024] stderr: #23 /var/www/vhosts/shop1/includes/src/OPC/PortletHtml.php(141): JTL\\Smarty\\JTLSmarty->fetch(), referer: https://***.com/
[Fri Oct 04 15:57:13.307660 2024] stderr: #24 /var/www/vhosts/shop1/includes/src/OPC/PortletHtml.php(117): JTL\\OPC\\Portlet->getHtmlFromTpl(), referer: https://***.com/
[Fri Oct 04 15:57:13.307676 2024] stderr: #25 /var/www/vhosts/shop1/includes/src/OPC/PortletHtml.php(33): JTL\\OPC\\Portlet->getFinalHtmlFromTpl(), referer: https://***.com/
[Fri Oct 04 15:57:13.307689 2024] stderr: #26 /var/www/vhosts/shop1/includes/src/OPC/PortletInstance.php(125): JTL\\OPC\\Portlet->getFinalHtml(), referer: https://***.com/
[Fri Oct 04 15:57:13.307702 2024] stderr: #27 /var/www/vhosts/shop1/includes/src/OPC/Area.php(86): JTL\\OPC\\PortletInstance->getFinalHtml(), referer: https://***.com/
[Fri Oct 04 15:57:13.307715 2024] stderr: #28 /var/www/vhosts/shop1/includes/src/OPC/PageService.php(102): JTL\\OPC\\Area->getFinalHtml(), referer: https://***.com/
[Fri Oct 04 15:57:13.307729 2024] stderr: #29 /var/www/vhosts/shop1/templates_c/NOVA/69ff22c05eea4686f9701cff6cef0867d2d19d0f_0.file.header.tpl.php(1295): JTL\\OPC\\PageService->renderMountPoint(), referer: https://***.com/
[Fri Oct 04 15:57:13.307742 2024] stderr: #30 /var/www/vhosts/shop1/includes/vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_inheritance.php(248): Block_138324553466ffeed268c439_61104261->callBlock(), referer: https://***.com/
[Fri Oct 04 15:57:13.307756 2024] stderr: #31 /var/www/vhosts/shop1/includes/vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_inheritance.php(184): Smarty_Internal_Runtime_Inheritance->callBlock(), referer: https://***.com/
[Fri Oct 04 15:57:13.307783 2024] stderr: #32 /var/www/vhosts/shop1/includes/vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_inheritance.php(156): Smarty_Internal_Runtime_Inheritance->process(), referer: https://***.com/
[Fri Oct 04 15:57:13.307802 2024] stderr: #33 /var/www/vhosts/shop1/templates_c/NOVA/69ff22c05eea4686f9701cff6cef0867d2d19d0f_0.file.header.tpl.php(1708): Smarty_Internal_Runtime_Inheritance->instanceBlock(), referer: https://***.com/
[Fri Oct 04 15:57:13.307816 2024] stderr: #34 /var/www/vhosts/shop1/includes/vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_inheritance.php(248): Block_54737430766ffeed258fed4_59903017->callBlock(), referer: https://***.com/
[Fri Oct 04 15:57:13.307830 2024] stderr: #35 /var/www/vhosts/shop1/includes/vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_inheritance.php(184): Smarty_Internal_Runtime_Inheritance->callBlock(), referer: https://***.com/
[Fri Oct 04 15:57:13.307844 2024] stderr: #36 /var/www/vhosts/shop1/includes/vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_inheritance.php(156): Smarty_Internal_Runtime_Inheritance->process(), referer: https://***.com/
[Fri Oct 04 15:57:13.307857 2024] stderr: #37 /var/www/vhosts/shop1/templates_c/NOVA/69ff22c05eea4686f9701cff6cef0867d2d19d0f_0.file.header.tpl.php(35): Smarty_Internal_Runtime_Inheritance->instanceBlock(), referer: https://***.com/
[Fri Oct 04 15:57:13.307877 2024] stderr: #38 /var/www/vhosts/shop1/includes/vendor/smarty/smarty/libs/sysplugins/smarty_template_resource_base.php(123): content_66ffeed275f2d0_53803128(), referer: https://***.com/
[Fri Oct 04 15:57:13.307899 2024] stderr: #39 /var/www/vhosts/shop1/includes/vendor/smarty/smarty/libs/sysplugins/smarty_template_compiled.php(114): Smarty_Template_Resource_Base->getRenderedTemplateCode(), referer: https://***.com/
[Fri Oct 04 15:57:13.307914 2024] stderr: #40 /var/www/vhosts/shop1/includes/vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php(217): Smarty_Template_Compiled->render(), referer: https://***.com/
[Fri Oct 04 15:57:13.307928 2024] stderr: #41 /var/www/vhosts/shop1/includes/src/Smarty/JTLSmartyTemplateClass.php(59): Smarty_Internal_Template->render(), referer: https://***.com/
[Fri Oct 04 15:57:13.307941 2024] stderr: #42 /var/www/vhosts/shop1/includes/vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php(386): JTL\\Smarty\\JTLSmartyTemplateClass->render(), referer: https://***.com/
[Fri Oct 04 15:57:13.307955 2024] stderr: #43 /var/www/vhosts/shop1/includes/src/Smarty/JTLSmartyTemplateClass.php(37): Smarty_Internal_Template->_subTemplateRender(), referer: https://***.com/
[Fri Oct 04 15:57:13.307978 2024] stderr: #44 /var/www/vhosts/shop1/templates_c/NOVA/76b79ee470b6edbe87f2e1c52d284bf5b8cee737_0.extends.header.tpl.php(24): JTL\\Smarty\\JTLSmartyTemplateClass->_subTemplateRender(), referer: https://***.com/
[Fri Oct 04 15:57:13.307992 2024] stderr: #45 /var/www/vhosts/shop1/includes/vendor/smarty/smarty/libs/sysplugins/smarty_template_resource_base.php(123): content_66ffeed25722c8_72994316(), referer: https://***.com/
[Fri Oct 04 15:57:13.308006 2024] stderr: #46 /var/www/vhosts/shop1/includes/vendor/smarty/smarty/libs/sysplugins/smarty_template_compiled.php(114): Smarty_Template_Resource_Base->getRendere, referer: https://***.com/
[Fri Oct 04 15:57:13.311887 2024] stderr: 2, referer: https://***.com/
 

OliverS

Gut bekanntes Mitglied
Mitarbeiter
1. April 2022
89
46
Hückelhoven
Als Fix kann hier in der /inludes/src/Media/Video.php ab ~Zeile 417 dieser Block hier:

PHP:
if ($this->type === self::TYPE_YOUTUBE) {
            $srcURL = 'https://i3.ytimg.com/vi/' . $this->id . '/maxresdefault.jpg';
        } elseif ($this->type === self::TYPE_VIMEO) {
            $videoXML = \json_decode(\file_get_contents('https://vimeo.com/api/v2/video/' . $this->id . '.json'));
            $srcURL   = $videoXML[0]->thumbnail_large ?? null;
        } else {
            return null;
        }

Mit diesem hier ersetzt werden:

PHP:
if ($this->type === self::TYPE_YOUTUBE) {
           $srcURL = 'https://i3.ytimg.com/vi/' . $this->id . '/maxresdefault.jpg';
       } elseif ($this->type === self::TYPE_VIMEO) {
           try {
               /** @var array<\stdClass> $videoXML */
               $videoXML = \json_decode(
                   \file_get_contents('https://vimeo.com/api/v2/video/' . $this->id . '.json') ?: '',
                   false,
                   512,
                   \JSON_THROW_ON_ERROR
               );
               $srcURL   = $videoXML[0]->thumbnail_large ?? null;
           } catch (\JsonException) {
               $srcURL = null;
           }
       } else {
           return null;
       }

Das ist in der nächsten Shop-Version bereits so implementiert.