Closed (fixed)
Project:
Drupal core
Version:
8.0.x-dev
Component:
migration system
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
19 Sep 2014 at 20:08 UTC
Updated:
17 Dec 2014 at 23:28 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
micnap commentedComment #2
micnap commentedComment #3
ultimikeHrm - we have test coverage for this in MigrateBlockTest - looking into it now...
-mike
Comment #4
ultimike@micnap - it looks like that if the block is disabled, then the page visibility settings aren't migrated - is this the same behavior you're seeing?
I manually tested this twice - once with a disabled block with page visibility settings and once with an enabled block (assigned to a region) with page visibility settings. I'm pretty sure we want to migrate the visibility settings regardless of if the block is disabled or not.
Also, I noticed that we aren't currently testing the role-based visibility settings (nor do they appear to be working). We define the "block_roles" table in the Drupal6Block dump file, but don't include any data for testing. I went ahead and added a some data and a (currently failing) assertion for this in MigrateBlockTest (patch attached).
This is a good issue for someone looking to get their feet wet in the Migrate in Core issue queue...
-mike
Comment #5
markie commentedComment #6
markie commentedOur story so far. The test successfully fails but there is a bigger issue we have discussed online. The migrate for blocks doesn't address importing user roles at all. I have added some functionality but the tests still fail and I am still not getting any good traction. So I offer a patch and a request for guidance.
Comment #7
benjy commentedThis patch looks like a good start. Not sure why we you're setting this so deep, can't we just set the into the "roles" key? Like so: $this->setSourceProperty('roles', $roles);
I think maybe we are going to need a dependency on d6_user_role, even if it's only soft so we can get the new machine_name of each role.
Setting to NR for the bot.
Comment #10
markie commentedSorry for my lack of participation. Here's a re-roll. of 2341683-block_visibility-6. I tried
$this->setSourceProperty('roles', $roles);but this still returned a negative test. Diving further into this tonight.Comment #12
ultimikeHmm - there's a lot going on with this issue...
Did we lose the original intention for this issue? Is the "Show block on specific pages" issue still valid? It looks like most of the discussion of this issue is around the role visibility. If so, we need to update the issue summary.
It's pretty clear that we need to add some code in order to migrate role visibility settings, and it is not so simple to do. Here's what a sample role visibility setting for a D8 block config looks like:
So, if role visibility is used on the source, then we need to build out this structure in the destination. Some questions/thoughts:
Thoughts?
-mike
Comment #13
ultimikeComment #14
benjy commentedWould be good if someone could retest this now that #2358269: Migration bugs in block visibility, field overrides, cron, maintenance settings and form modes found by configuration schema checking has been committed.
Comment #15
ultimikeThe page related visibility settings are all working as far as I can tell.
There's an issue with the role visibility settings, but I'll open a new issue for that.
-mike