Problem/Motivation
The visibility settings of blocks with translations are not migrated. This was discovered while working on #2225681: Migrate D6 i18n blocks translated strings
In #90 of that issue maxocub wrote:
What I understood and what I tried was:
1) Fresh D6 install
2) Enable i18nblocks
3) Add a language, say French
4) Enable path prefix for language selection
5) Go to the Blocks page
6) Configure a block, say Navigation
7) Chose French in the languages selection
8) Now, if you are seeing the site in English, you don't see the Navigation block, but if you see it in French (/fr) you see it.
9) Then if you migrate, on the D8 site the Navigation block is visible on both English and French, which is not the same behavior as on the D6 site.
If on the D8 site I configure the Main Navigation block and select French, then the visibility configuration of the block will be:
visibility:
language:
id: language
langcodes:
fr: fr
negate: false
context_mapping:
language: '@language.current_language_context:language_interface'But in the above migration scenario, the visibility configuration of the block is empty.
Proposed resolution
Write a patch.
Remaining tasks
Do it.
User interface changes
N/A
API changes
N/A
Data model changes
N/A
| Comment | File | Size | Author |
|---|---|---|---|
| #20 | migrate-block-language-visibility-settings-2903579-20.patch | 3.63 KB | iwayman |
Comments
Comment #2
quietone commentedJust a comment that phenaproxima said during the Vienna sprint that he recalls in D8 a block either exists or it doesn't so that the visibility settings are interesting.
Comment #8
quietone commentedComment #15
fengtanComment #16
fengtanHere is a patch that migrates language visibility records.
Comment #17
needs-review-queue-bot commentedThe Needs Review Queue Bot tested this issue. It fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".
This does not mean that the patch needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.
Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.
Comment #18
fengtanFixed indentation.
Comment #20
iwayman commentedUse language context_mapping instead of node when migrating language visibility.
Comment #21
quietone commentedThe Migrate Drupal Module was approved for removal in #3371229: [Policy] Migrate Drupal and Migrate Drupal UI after Drupal 7 EOL.
This is Postponed. The status is set according to two policies. The Remove a core extension and move it to a contributed project and the Extensions approved for removal policies.
The deprecation work is in #3522602: [meta] Tasks to remove Migrate Drupal module and the removal work in #3522602: [meta] Tasks to remove Migrate Drupal module.
Migrate Drupal will not be moved to a contributed project. It will be removed from core after the Drupal 12.x branch is open.
Comment #23
quietone commentedThe Migrate Drupal Module and Migrate Drupal UI are deprecated and they are not in Drupal 12.0.0.
Issues for these modules should now be on the 11.x branch. And the changes are limited to critical and major bug fixes. Other changes are allowed at the discretion of the core Release Managers in consultation with the Migrate subsystem maintainers.