Closed (duplicate)
Project:
Drupal core
Version:
8.3.x-dev
Component:
language system
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
27 Jul 2015 at 20:05 UTC
Updated:
21 Mar 2017 at 11:04 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
gábor hojtsyRight, I don't think Drupal core ever solved the problem of deleting a language which has content/configuration in it. Content that was translated to that language as well as configuration in that language will start behaving unpredictably when removing languages. We should be moving this to the core queue and elevating to critical if we can reproduce with core only. I tried the following step but failed:
1. Install in English.
2. Add Afrikaans.
3. Enable articles for content translation.
4. Add an article, translate it to Afrikaans too.
5. Remove Afrikaans.
6. Visit admin/content. No WSOD. :/
Can you reproduce with core too?
Comment #2
kristen polI just tried with latest demo version (8.0.0 core) and do get a fatal error:
Fatal error: Call to a member function getId() on a non-object in /home/dmmcm/www/core/modules/system/src/Plugin/views/field/BulkForm.php on line 454Comment #3
gábor hojtsyI think this is a core bug. I did try to reproduce it with core only though unsuccessfully :/ We don't change anything about the node admin page, so not sure why would it only come up with the demo...
Comment #4
kristen polPostponing for now so we can do some more testing to see if it's a core issue.
Comment #5
loopduplicate commentedI can reproduce this with just Drupal core.
* Install latest Drupal 8 with English as the default language
* Enable language and content translation modules
* Add Afrikaans and Albanian to languages (make sure to install both languages)
* Enable translation on the Article content type
* Add a node in English
* Translate the node in Afrikaans and Albanian
* Remove Afrikaans from languages
* Visit admin/content
* Server error
PHP Fatal error: Call to a member function getId() on null in /Applications/MAMP/htdocs/d8sandbox/docroot/core/lib/Drupal/Core/Entity/Entity/EntityViewDisplay.php on line 259Comment #6
SakaSerbia commented* Install latest Drupal 8 with English as the default language
* Enable language and content translation modules
* Add Serbian and Albanian to languages (make sure to install both languages)
* Enable translation on the Article content type
* Add a node in Serbian
* Translate the node in Serbian and Albanian
* Remove Albanian from languages
* Visit admin/content
* Server error
Fatal error: Call to a member function getId() on null in /beta2/core/lib/Drupal/Core/Entity/Entity/EntityViewDisplay.php on line 259
For me error is no page and /rs. Front page in EN work perfect.
Comment #7
SakaSerbia commentedI uninstall and after install the theme in admin/appearance and bag is fixed..
Comment #8
loopduplicate commentedHi s-a-k-a,
I'm having trouble understanding your last comment. Can you clarify it a bit?
Thanks,
loopduplicate
Comment #9
catchWe should probably prevent deletion of the language if there's any content in the language.
I can see that being annoying if there's only translations and you really want to remove support for a language, but we don't support bulk deletes properly yet.
Comment #10
gábor hojtsyRight, that sounds like an API addition to ask everyone that may want to stop deleting a language. There may be path aliases in that language, config translations, locale translations, etc. So far only content has issues with WSOD-ing when the language is not there, but the question is whether we should be consistent with the rest of them as well.
Comment #11
catchWe should probably prevent deletion of the language if there's any content in the language.
I can see that being annoying if there's only translations and you really want to remove support for a language, but we don't support bulk deletes properly yet so removal isn't doable at the moment.
Comment #13
cilefen commentedRelated: #2640496: Revision ID in {node} and {node_revision} can get out of sync
Comment #15
rcodinaAny update on this? I think there should be a warning message before deletion that recommends you about deleting any content in the language you want to remove.
Comment #16
gábor hojtsy@rcodina: right, we need a system first to identify all "content" (taxonomy terms, users, products, rules, views, etc.) in the language you are deleting. Introducing such a system would be the next step.
Comment #18
cgmonroe commentedWe had to remove a language that was partially implemented when the Powers That Be decided not to translate the bulk of the content.
In order to remove the language, I needed to identify all the translated content. I did this with the quick script below. It just handles the entities and not views or other items. But it was good enough for what we needed.
Posting it just to help others in this situation and possibly usable in the final solution.
Best run via the "drush scr" command. It will print out the entity type and id of entities that have translations in the specified language .
This info can be used to go into the GUI and remove the translations. E.g. if it's a node type, /node/###/translations to get to the list of translations, then you can delete the language you don't want from there. Menus, blocks, and the like all have similar URLs that you can plug the id into. Still a pain but faster than trying to find these manually.
Once you've deleted the unwanted translations for these entities, you probably can safely remove the language. The main reasons for the WSOD is the entity admin screens. YMMV
NOTES:
If you are using paragraph entities (paragraphs module), deleting the node translation should delete these for you.
You may need to manually check for translated menu's (not menu link items) as these are config items and not entities.
Here's the script
Comment #19
roderikClosing in favor of #2851029 since that was updated last.