With contact_cc, contact_storage installed I cannot delete a contact form.

I get the following:

The website encountered an unexpected error. Please try again later.
Recoverable fatal error: Argument 1 passed to contact_cc_entity_delete() must be an instance of EntityInterface, instance of Drupal\contact\Entity\ContactForm given in contact_cc_entity_delete() (line 65 of modules/contrib/contact_cc/contact_cc.module).
contact_cc_entity_delete(Object, 'contact_form')
call_user_func_array('contact_cc_entity_delete', Array) (Line: 402)
Drupal\Core\Extension\ModuleHandler->invokeAll('entity_delete', Array) (Line: 371)
Drupal\Core\Config\Entity\ConfigEntityStorage->invokeHook('delete', Object) (Line: 369)
Drupal\Core\Entity\EntityStorageBase->delete(Array) (Line: 366)
Drupal\Core\Entity\Entity->delete() (Line: 122)
Drupal\Core\Entity\EntityDeleteForm->submitForm(Array, Object)
call_user_func_array(Array, Array) (Line: 111)
Drupal\Core\Form\FormSubmitter->executeSubmitHandlers(Array, Object) (Line: 51)
Drupal\Core\Form\FormSubmitter->doSubmitForm(Array, Object) (Line: 583)
Drupal\Core\Form\FormBuilder->processForm('contact_form_delete_form', Array, Object) (Line: 314)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 74)
Drupal\Core\Controller\FormController->getContentResult(Object, Object)
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: 50)
Drupal\ban\BanMiddleware->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)
CommentFileSizeAuthor
#2 contact_cc-2763439-cannot-delete-contact-forms.patch480 bytesAnonymous (not verified)

Comments

Anonymous’s picture

vilepickle created an issue. See original summary.

Anonymous’s picture

This patch stops the type check on the contact_cc_entity_delete() function argument and allows forms to be deleted

Anonymous’s picture

Status: Active » Needs review
arbee’s picture

Thank you for pointing this out. I suspect your patch will work perfectly, I'm just updating my D8 install to the latest to test it locally.

  • arbee committed 9dc42b1 on 8.x-1.x authored by vilepickle
    Issue #2763439 by vilepickle: Cannot delete contact forms
    
arbee’s picture

Your fix has been rolled into 8.x-1.2 release. Thanks again.

Anonymous’s picture

Status: Needs review » Closed (fixed)

Thanks!