- Issue created by @kensae
- Merge request !21Check if $this->definition has the method getPropertyDefinitions to prevent an... β (Merged) created by kensae
- πΊπΈUnited States mradcliffe USA
getPropertyDefinition comes from \Drupal\Core\TypedData\ComplexDataDefinitionInterface and \Drupal\Core\TypedData\ComplexDataDefinitionBase which implements that method.
As far as I remember, all xero data type plugins should use a complex data definition, but I think that Drupal's Typed Data Manager will technically let a data type be instantiated with a different definition. My guess is that something happened during denormalization that caused the data type to be instantiated incorrectly.
- π§πͺBelgium kensae
In my case, this error is happening when trying to add a Xero Reference with the xero autocomplete widget to a Xero Item. It fails when trying to getProperties on the xero Detail Datatype.
- π§πͺBelgium kensae
It seems to be an issue in \Drupal\xero\TypedData\Definition\ItemDefiniton, where the class DataDefinition for
$info['PurchaseDetails'] = DataDefinition::create('xero_detail')->setLabel('Purchase Details'); $info['SalesDetails'] = DataDefinition::create('xero_detail')->setLabel('Sales Details');should be:
$info['PurchaseDetails'] = DetailDefinition::create('xero_detail')->setLabel('Purchase Details'); $info['SalesDetails'] = DetailDefinition::create('xero_detail')->setLabel('Sales Details'); - πΊπΈUnited States mradcliffe USA
Thank you for finding the root cause. This looks good to me. I added a test to go through non-list properties that start with "xero" and assert the definition interface.
-
mradcliffe β
committed a6e9b1f8 on 3.1.x authored by
kensae β
Issue #3539326 by kensae, mradcliffe: Call to undefined method Drupal\...
-
mradcliffe β
committed a6e9b1f8 on 3.1.x authored by
kensae β