#2708601: Allow per-field diff configuration introduced a regression for fields where a plugin cannot be found when doing a diff between two revisions with certain field types. The attached patch appears to resolve it.
The specific field that failed was an og membership reference field.
The resulting exception looks like this:
Drupal\Component\Plugin\Exception\PluginNotFoundException: The "" plugin does not exist. in Drupal\Core\Plugin\DefaultPluginManager->doGetDefinition() (line 52 of core/lib/Drupal/Component/Plugin/Discovery/DiscoveryTrait.php).
Drupal\Core\Plugin\DefaultPluginManager->getDefinition(NULL) (Line: 16)
Drupal\Core\Plugin\Factory\ContainerFactory->createInstance(NULL, Array) (Line: 84)
Drupal\Component\Plugin\PluginManagerBase->createInstance(NULL, Array) (Line: 108)
Drupal\diff\DiffEntityParser->parseEntity(Object) (Line: 116)
Drupal\diff\EntityComparisonBase->compareRevisions(Object, Object) (Line: 84)
Drupal\diff\Controller\NodeRevisionController->compareNodeRevisions(Object, '179365', '180181', 'raw')
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 574)
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}()
call_user_func_array(Object, Array) (Line: 139)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 62)
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: 98)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 77)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 50)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 628)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
Comments
Comment #2
rfayPatch appears to resolve this problem.
Comment #4
miro_dietikerDoes this only affect stale data after update?
Or are the plugins newly properly dealing with dependency and config uninstalled when a module with plugins is uninstalled?
Comment #5
johnchqueActually it makes sense, since there can be some fields without any plugin available. Should we add test coverage for it?
Comment #6
johnchqueOf course right? It is a bug.
Comment #7
miro_dietikerComment #8
johnchqueTests added, test-only = interdiff. Discussed with @Berdir, removed support for changed field and path. :)
Comment #10
miro_dietikerYeah this looks fine.
However, you state "tests a field without plugins". Not telling what field.
All the issue that you proof is implicitly covered.
Please make explicit statement about what is missing and what we are asserting (such as a comment about what the problem was where it failed when hitting Compare...)
Comment #11
johnchqueTrue, added better comments. :)
Comment #12
johnchqueForgot the interdiff. :)
Comment #13
johnchqueSorry, uploaded the wrong files.
Comment #15
miro_dietikerOK Committed.
Please don't forget that the method docblock is the location where you need to describe the scenario. I extended it pointing at the specific case of the changed field without a plugin.
Comment #16
johnchqueWill take note for the next time, thank you. :)