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

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

swentel created an issue. See original summary.

swentel’s picture

Status: Active » Needs review
FileSize
2.76 KB

Here's a failing test

Status: Needs review » Needs work

The last submitted patch, 2: 2688003-2.patch, failed testing.

The last submitted patch, 2: 2688003-2.patch, failed testing.

Gábor Hojtsy’s picture

prevent switching default language when content is made in another already and language module is still enabled?

Does not sound feasible. Why should you not be able to swap default language in this state?

reset default_langcode in system.site and reset all content back when language module is uninstalled

Does default langcode even matter for this bug or would it apply even if there was a node in another language once language module is disabled? Would be good to clear that up first, if the default langcode change is required for this bug or not in the first place.

swentel’s picture

Yeah, 1 is not feasible indeed, was just thinking out load there :)

As for 2: no default langcode update does not matter for this bug, it's the value of the langcode (nl which does no exist anymore as a language) for that node that is not valid.

Gábor Hojtsy’s picture

Right, so we don't do any data updates when you remove Dutch but still have language module enabled although that would have similar effects, no? At least if you don't have the language selector on a content type for example. You would get an invalid language and no way to select something else. It would indeed be great to have an API to tell people if there are things dependent on the language and either not let them remove a language / uninstall language module or offer them to remedy the problem by applying a separate language. But that would need to be an open API so anything associating language with things can react. We don't know nor have control over what associates language to something. Eg. its easy to set up an entity reference field to reference languages.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.0-beta1 was released on August 3, 2016, which means new developments and disruptive changes should now be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.0-alpha1 will be released the week of January 30, 2017, which means new developments and disruptive changes should now be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.0-alpha1 will be released the week of July 31, 2017, which means new developments and disruptive changes should now be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.0-alpha1 will be released the week of January 17, 2018, which means new developments and disruptive changes should now be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.7.x-dev

Drupal 8.6.0-alpha1 will be released the week of July 16, 2018, which means new developments and disruptive changes should now be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

quietone’s picture

Issue summary: View changes
Status: Needs work » Active
Issue tags: +Bug Smash Initiative, +Needs issue summary update

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.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.