Lullabot / media_mpx

Integrates lullabot/mpx-php with Drupal 8
3 stars 3 forks source link

Unable to add a new mpx type on PHP 7.3 #147

Closed deviantintegral closed 1 year ago

deviantintegral commented 5 years ago

When running with PHP 7.3, the form cache throws an error on unserialize() when trying to add an mpx media type. It works fine in PHP 7.2. I can add other media types, which makes me wonder if #ajax is part of the issue. My closest result is https://github.com/symfony/symfony/issues/29459 and https://bugs.php.net/bug.php?id=77302 which may mean something is broken in <7.2, but just silently failing.

salvamomo commented 5 years ago

Just to be sure. It's not the same scenario of this PR, is it? https://github.com/Lullabot/media_mpx/pull/145. Seems completely different, but just double checking 👍

deviantintegral commented 5 years ago

Yeah, not the same, in this one unserialize() fails with a parse error notice.

goba commented 4 years ago

Does this still happen? Asking because this was raised as an outstanding PHP compatibility issue in https://www.drupal.org/project/drupal/issues/3106075

deviantintegral commented 4 years ago

Good question! @m4olivei have any of the sites we know of using this upgraded to PHP 7.3 or 7.4 yet? When I last worked on this I believe we were on 7.2 and I only ran into this on my local.

m4olivei commented 4 years ago

Our sites that are using media_mpx are on 7.1 and 7.2. There are plans to update to 7.3, but there isn't a lot of momentum on that, and we're dependent on our infrastructure group. All that is to say, we don't have a solid timeline.

FWIW, I updated my local to PHP 7.3 and tested this. The site is currently on Drupal 8.7.7 and the error still occurs:

Notice: unserialize(): Error at offset 12148 of 100815 bytes in Drupal\Component\Serialization\PhpSerialize::decode() (line 21 of core/lib/Drupal/Component/Serialization/PhpSerialize.php).
Drupal\Component\Serialization\PhpSerialize::decode( <giant serialzed string> )
array_map(Array, Array) (Line: 55)
Drupal\Core\KeyValueStore\DatabaseStorageExpirable->getMultiple(Array) (Line: 35)
Drupal\Core\KeyValueStore\StorageBase->get('form-vTNFABRS1q9HSENyqJNUCycf6ZdlFnT4mM0f0a1G6v8') (Line: 121)
Drupal\Core\Form\FormCache->getCache('form-vTNFABRS1q9HSENyqJNUCycf6ZdlFnT4mM0f0a1G6v8', Object) (Line: 439)
Drupal\Core\Form\FormBuilder->getCache('form-vTNFABRS1q9HSENyqJNUCycf6ZdlFnT4mM0f0a1G6v8', Object) (Line: 262)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 93)
Drupal\Core\Controller\FormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 582)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 151)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 68)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 52)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 693)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

As a sidenote, my understanding is that Drupal core isn't ready for PHP 7.4 yet.