Uninstalling language module leaves content uneditable if the default language doesn't exist anymore

Created on 15 March 2016, almost 9 years ago
Updated 27 February 2023, about 2 years ago

Problem/Motivation

It is possible to uninstall language module when there is content in that language.

Related: I also had a weird behavior with config entities, but this might be a problem with config translation which is probably covered by #2595535: Show helpful message (do not fatal!) when configuration files have different source language codes and cannot be translated - although it's only a half solution in the end (but it's a good start to not fatal at least). I'll try to figure out again how I got there with that - in short what I saw after I uninstall language: there were some overrides for 'en'. e.g. for the basic content type, it still had the original description, but the default config entity didn't have it. In the UI, on /node/add, the override was still seen, but not in the edit form which is extremely confusing.

Steps to reproduce

  • Install standard core
  • Create article one - promote to homepage, make sure it has a body
  • Install language module
  • Install a second language
  • Make that second language the default
  • Create article two - promote to homepage, make sure it has a body
  • Uninstall the language module
  • Try to update article two: this will fail with the message 'The value you selected is not a valid choice.' Updating article one is fine.
  • visit the frontpage or detail page of the second node- you will not see the body of the second article - you'd assume you want to see it though. Titles are fine.

run drush cedit system.site and you'll see that default_langcode is still set to whatever default language you've chosen.

Proposed resolution

- prevent switching default language when content is made in another already and language module is still enabled?
- reset default_langcode in system.site and reset all content back when language module is uninstalled ?

Remaining tasks

Decide how to resolve
Patch
Review
Commit

User interface changes

API changes

Data model changes

Release notes snippet

🐛 Bug report
Status

Active

Version

10.1

Component
Language module 

Last updated 6 days ago

  • Maintained by
  • 🇩🇪Germany @sun
Created by

🇧🇪Belgium swentel

Live updates comments and jobs are added and updated live.
  • D8MI

    (Drupal 8 Multilingual Initiative) is the tag used by the multilingual initiative to mark core issues (and some contributed module issues). For versions other than Drupal 8, use the i18n (Internationalization) tag on issues which involve or affect multilingual / multinational support. That is preferred over Translation.

  • Needs issue summary update

    Issue summaries save everyone time if they are kept up-to-date. See Update issue summary task instructions.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇳🇿New Zealand quietone

    I tested on Drupal 10.1.x, using the steps in the issue summary. I was able to reproduce the problem.

    The proposed resolution needs an update based on #5-#7.

    I am setting to Active as it appears that this needs a new approach.

Production build 0.71.5 2024