Commit 9ace058e authored by john_a's avatar john_a Committed by John Avery
Browse files

Issue #2975670 by john_a: unable to uninstall marketing_cloud_example if the...

Issue #2975670 by john_a: unable to uninstall marketing_cloud_example if the webform has been deleted
parent 748923b9
......@@ -14,10 +14,12 @@ use Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException;
function marketing_cloud_example_uninstall() {
// Delete 'marketing_cloud_example' webform.
try {
\Drupal::entityTypeManager()
$webformEntity = \Drupal::entityTypeManager()
->getStorage('webform')
->load('marketing_cloud_example')
->delete();
->load('marketing_cloud_example');
if (!is_null($webformEntity)) {
$webformEntity->delete();
}
}
catch (InvalidPluginDefinitionException $e) {
\Drupal::logger(__FUNCTION__)->info('an error occurred trying to delete the marketing cloud example webform: %message', ['%message' => $e->getMessage()]);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment