Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 295445

Disallow removing a language when there is content in that language

$
0
0

Problem

After removing a language that has at least one content translation created, any subsequent attempt to load /admin/content results in the following error:

The website encountered an unexpected error. Please try again later.
Error: Call to a member function getId() on null in Drupal\Core\Entity\Entity\EntityViewDisplay->buildMultiple() (line 254 of core/lib/Drupal/Core/Entity/Entity/EntityViewDisplay.php).

Proposed resolution

I don't feel qualified to offer fixes to Drupal core yet but I think the culprit is the statement
$view_langcode = $entity->language()->getId();
When you remove a language you get a warning that all translations to that language will be marked as undefined. Well, that statement apparently is trying to getId() of undefined...


Viewing all articles
Browse latest Browse all 295445


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>