The following Fatal error appears when modules Field and Language are not installed:
Class 'Drupal\language\Entity\ConfigurableLanguage' not found in /.../languagefield/src/Plugin/Field/FieldFormatter/LanguageFormatter.php on line 106

Steps to reproduce:
1. Install & enable Language field module
2. Add a language field to a content type
3. Make sure the language field is visible in the display settings
4. Save a node with a language field

The error goes away if you disable the language field from the display in content type OR if you enable the `language` field in core.

Should this module maybe be dependent on the core language module?

CommentFileSizeAuthor
#2 missing-dependency-2834573-2.patch313 bytesgerzenstl

Comments

matsbla created an issue. See original summary.

gerzenstl’s picture

Assigned: Unassigned » gerzenstl
Status: Active » Needs review
StatusFileSize
new313 bytes

@matsbla to solve this error, enable the "Language" module that is available on Drupal core.

I submitted a patch to prevent this issue by adding that module as a dependency.

matsbla’s picture

Status: Needs review » Reviewed & tested by the community

@gerzenstl
Yes I know as that is what I also wrote :)

Thanks for patch!

johnv’s picture

Title: Fatal error: Class 'Drupal\language\Entity\ConfigurableLanguage' not found in /home/d1s8c/www/sites/default/modules/languagefield/src/Plugin/Field/FieldFormatter/LanguageFormatter.php on line 106 » Fatal error due to missing dependencies
Issue summary: View changes

  • johnv committed 7c75faf on 8.x-1.x authored by gerzenstl
    Issue #2834573 by gerzenstl: Fatal error due to missing dependencies
    
johnv’s picture

Version: 8.x-1.x-dev » 8.x-1.2
Status: Reviewed & tested by the community » Fixed

Committed. Thanks!

gerzenstl’s picture

You're welcome!

Let me know if I can help with another issue.

johnv’s picture

Assigned: gerzenstl » Unassigned

Just check the issue queue! :-)

Status: Fixed » Closed (fixed)

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