Follow-up to #2528178: Provide an upgrade path for blocks context IDs #2354889 (context manager)

Problem/Motivation

The BlockVisibility migrate process plugin migrates the user.current_user context without the Context Id added in #2528178: Provide an upgrade path for blocks context IDs #2354889 (context manager). This causes an exception to be thrown after migration when going to a page with a block that uses block visibility.

Proposed resolution

Change the BlockVisibility process plugin to use the new Context Id for user.current_user: @user.current_user_context:current_user.

core/module/block/src/Plugin/migrate/process/d6/BlockVisibility.php

      $visibility['user_role']['context_mapping']['user'] = 'user.current_user';

The fix in the above is trivial, but writing an assertion in the test class is going to take a bit of thought.

Remaining tasks

  • Write patch that adds some assertion in the migration test for blocks
  • Review patch
  • Manual test?
  • Write beta evaluation

User interface changes

None.

API changes

None.

Data model changes

Probably none.

Beta phase evaluation

Reference: https://www.drupal.org/core/beta-changes
Issue category Bug/Task/Feature because ...
Issue priority Major because ... Critical/Not critical because ...

Comments

mradcliffe created an issue. See original summary.

mradcliffe’s picture

Status: Active » Closed (duplicate)

I knew I saw this earlier today, but I could not find it searching the issue queue tonight. :(

#2547395: Migration for block visibility on user roles in broken