Working on #2551945: PaymentLineItemsInput AJAX does not work I got an error when submitting a second request after an Ajax one:

Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException: You have requested a non-existent service "". in Drupal\Component\DependencyInjection\Container->get() (line 159 of core/lib/Drupal/Component/DependencyInjection/Container.php).
Drupal\plugin\Plugin\DataType\PluginInstance->__wakeup()

During the first AJAX request, the form gets cached and DependencySerializationTrait tries to Serialize a Basic LineItem but something fails in the __sleep call. I don't understand why this conditional in line 31 of DependencySerializationTrait

if (is_object($value) && isset($value->_serviceId))

returns true when $value is set to PaymentForm while $value->_serviceId is actually null.

During the second request (AJAX or not) the execption above is thrown during the corresponding __wakeup call because it tries to get null from the service container.

Comments

esclapes created an issue. See original summary.

Xano’s picture

Project: Payment » Plugin
Status: Active » Fixed

I assume this problem no longer occurs, since \Drupal\plugin\Plugin\DataType\PluginInstance->__wakeup() was removed some time ago. Please re-open this issue if the problem is still current, though.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.