I am writing a patch for a module that used an old beta or even alpha of webform for drupal 8.
There is a line
WebformEntityReferenceItem::getEntityWebformFieldName($node); in the module that errors out saying
getEntityWebformFieldName() does not exist and sure enough in
Drupal\webform\Plugin\Field\FieldType\WebformEntityReferenceItem the method does not exist.
I checked an older release and the method was there at some point. I've been searching since yesterday but cannot find a workaround or even an answer as to why it was removed. Any ideas?
So I managed to get it working, but this certainly seems like the incorrect way to do it.
So it seems
WebformEntityReferenceItem::getEntityWebformFieldName($node); just gets the webform on the webform node and then grabs its 'target_id' value.
$webform_field_name = WebformEntityReferenceItem::getEntityWebformFieldName($node); $webform_id = $node->$webform_field_name->target_id;
What I posted in my edit, I do not believe is the correct solution, albeit it is now working. Any suggestions would be appreciated.