Skip to content

Commit d178aa2

Browse files
author
Mateu Aguiló Bosch
committed
[BUGFIX] Fix the resource plugin reference
So the cache placeholder population can load the plugin.
1 parent 10d6deb commit d178aa2

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

src/Plugin/formatter/FormatterJsonApi.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -424,10 +424,11 @@ protected function embedField(ResourceFieldInterface $resource_field, $parent_id
424424
return NULL;
425425
}
426426
$ids = $cardinality == 1 ? $ids = array($ids) : $ids;
427+
$resource_info = $resource_field->getResource();
427428
$empty_value = array(
428429
'#fields' => array(),
429430
'#embedded' => TRUE,
430-
'#resource_plugin' => $resource_field->getResourceMachineName(),
431+
'#resource_plugin' => sprintf('%s:%d.%d', $resource_info['name'], $resource_info['majorVersion'], $resource_info['minorVersion']),
431432
'#cache_placeholder' => array(
432433
'parents' => array_merge($parents, array($public_field_name)),
433434
'parent_hashes' => $parent_hashes,

src/Plugin/resource/Decorators/ResourceDecoratorBase.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,13 @@ public function doDelete($path) {
368368
return $this->process();
369369
}
370370

371+
/**
372+
* {@inheritdoc}
373+
*/
374+
public function getPluginId() {
375+
return $this->subject->getPluginId();
376+
}
377+
371378
/**
372379
* If any method not declared, then defer it to the decorated field.
373380
*

0 commit comments

Comments
 (0)