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
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | 3215980.patch | 2.13 KB | chr.fritsch |
Comments
Comment #2
chr.fritschThe old code had other flaws. So I think this is a better solution.
Comment #4
chr.fritschDone