When going to contact page with an argument in the URL, the page breaks with following error.
The website encountered an unexpected error. Please try again later.
Recoverable fatal error: Argument 1 passed to Drupal\metatag\MetatagManager::tagsFromEntity() must implement interface Drupal\Core\Entity\ContentEntityInterface, instance of Drupal\contact\Entity\ContactForm given, called in metatag.module on line 217 and defined in Drupal\metatag\MetatagManager->tagsFromEntity() (line 53 of modules/contrib/metatag/src/MetatagManager.php).
To reproduce: install standard, surf to /contact/feedback. Note that /contact is fine.
Comments
Comment #2
swentel commentedComment #3
swentel commentedAlso, when going to /contact, there's no title in the title tag, only the site name - but likely unrelated to this - and tricky, this is page which relies on a config entity, which is probably the underlying problem. Should probably be a separate issue.
Comment #4
damienmckennaCommitted. Thanks.
Comment #7
damienmckennaComment #9
stewestWhen going to the url of our (non default) contact/contact_form we get a WSOD.
LOG:
Recoverable fatal error: Argument 1 passed to Drupal\metatag\MetatagManager::tagsFromEntity() must implement interface Drupal\Core\Entity\ContentEntityInterface, instance of Drupal\contact\Entity\ContactForm given, called in /var/www/oursite/public_html/modules/contrib/metatag/metatag.module on line 217 and defined in Drupal\metatag\MetatagManager->tagsFromEntity() (line 53 of /var/www/oursite/public_html/modules/contrib/metatag/src/MetatagManager.php).
We're using: [updated]
Metatag 8.x-1.0-beta3
Drupal 8.0.1
DB: 10.0.23-MariaDB-1~trusty-log
PHP 5.5.9-1ubuntu4.14
Comment #10
damienmckenna@sideswitch: Are you using the current -dev release or beta3?
Comment #11
Florpunch commentedSame issue for me but the personal contact page /contact works well.
Recoverable fatal error: Argument 1 passed to Drupal\metatag\MetatagManager::tagsFromEntity() must implement interface Drupal\Core\Entity\ContentEntityInterface, instance of Drupal\contact\Entity\ContactForm given, called in /modules/metatag/metatag.module on line 217 and defined in Drupal\metatag\MetatagManager->tagsFromEntity() (line 53 of /modules/metatag/src/MetatagManager.php).Metatag: 8.x-1.0-beta3
Drupal: 8.0.2
Database: 5.5.5-10.1.9-MariaDB
PHP: 5.6.15
Comment #12
swentel commentedThis fix isn't included in beta3 yet, so you either need to download the dev version or wait for beta4.
Comment #13
glynster commentedRan into the same problem with the latest dev version installed and received the following error:
Recoverable fatal error: Argument 1 passed to Drupal\metatag\MetatagManager::tagsFromEntity() must implement interface Drupal\Core\Entity\ContentEntityInterface, instance of Drupal\contact\Entity\ContactForm given, called in /home/sitename/subdomains/dev/modules/contrib/metatag/metatag.module on line 217 and defined in Drupal\metatag\MetatagManager->tagsFromEntity() (line 53 of /home/sitename/subdomains/dev/modules/contrib/metatag/src/MetatagManager.php).Comment #14
glynster commented@swentel I inspected latest dev and it would seem this patch was missed out on the latest release? Once patched works as it should.
Comment #15
damienmckennaI guess the problem wasn't fixed, then :-\
Comment #16
damienmckennaComment #17
N1ckN4m3 commentedHi,
there is a problem with metatag and contact forms (D8).
unless contact form link is standard contact, all contact form links are broken.
example:
=
if i deactivate metatag module all is fine, but if i activate this module the error above appears (its the one and only error i found).
How can i fix it?
Regards
Comment #18
swentel commentedI can't reproduce this, works fine for me here.
Comment #19
tannerjfco commentedI was experiencing this issue, updating to the current dev release resolved the issue for me.
Comment #20
damienmckennaSo lets add some tests to confirm it works.
Comment #21
damienmckennaComment #22
mr.baileysComment #23
swentel commentedmaybe we should add an assertResponse(200) after ?
Comment #24
damienmckennaYes, please add an assertResponse(200) after every drupalGet() call.
Comment #25
damienmckennaThis adds the extra assertResponse().
Comment #26
damienmckennaComment #27
damienmckennaCommitted. Thanks mr.baileys!
Comment #29
damienmckennaClosed a duplicate: #2662168: Metatags seems to be throwing an error on Drupal Contact Forms