Problem/Motivation

Error: Call to undefined method Drupal\views\ViewExecutable::getEntityType() in access_unpublished_tokens() (line 47 of /docroot/modules/contrib/access_unpublished/access_unpublished.tokens.inc)

Steps to reproduce

Error happend after the module upgarde from 8.x-1.0 to 8.x-1.1

Proposed resolution

Replace
if (!empty($data['entity']) && AccessUnpublished::applicableEntityType($data['entity']->getEntityType())) {
with old code and it works
if (!empty($data['entity']) && $data['entity'] instanceof EntityPublishedInterface) {

Remaining tasks

User interface changes

API changes

Data model changes

CommentFileSizeAuthor
#2 3215980.patch2.13 KBchr.fritsch

Comments

sanoopuio created an issue. See original summary.

chr.fritsch’s picture

Status: Active » Needs review
StatusFileSize
new2.13 KB

The old code had other flaws. So I think this is a better solution.

  • chr.fritsch committed 3171e24 on 8.x-1.x
    Issue #3215980 by chr.fritsch: Error: Call to undefined method Drupal\...
chr.fritsch’s picture

Status: Needs review » Fixed

Done

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.