Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Migrate now allows a proper way for class registration.
Comment | File | Size | Author |
---|---|---|---|
#27 | 1866950-og-migrate-26.patch | 2.79 KB | amitaibu |
og-migrate2.5.patch | 5.83 KB | amitaibu | |
Comments
Comment #1
amitaibuCommitted.
Comment #2
danylevskyiAmitaibu, your patch causes problem with Drush migrate command.
Please, see this: #1869052: drush mi: Failure to sort migration list
Comment #3
amitaibuMaybe that caused your error -- that's the only "big" change in the patch. That migrate was never registered, although it should.
Comment #4
danylevskyiI'll investigate the problem later, but I am 100% sure that problem in this commit.
Comment #5
amitaibuI believe you :)
Try removing
$migrations['OgUiPopulateField'] = array('class_name' => 'OgUiPopulateField');
to see if that's the cause.btw, what are you working on? :)
Comment #6
danylevskyiIt seems that problem in "if (db_table_exists('d6_og'))" statements.
Removing
$migrations['OgUiPopulateField']
doesn't remove error.Comment #7
amitaibuAre you with Migrate 2.5?
Comment #8
danylevskyiYes, Migrate 2.5
Comment #9
amitaibu> It seems that problem in "if (db_table_exists('d6_og'))" statements.
You mean removing them caused the WSOD? Sounds like a Migrate issue, especially since it works ok via the UI.
Comment #10
danylevskyiYes, I mean removing them caused error.
Need more time to investigate...
Comment #11
jpklein CreditAttribution: jpklein commentedI started getting a WSOD via the UI at "admin/content/migrate" after upgrading OG from 2.0-beta3 to rc1. Issuing "drush ms" from the command-line displayed the following error message: "Failure to sort migration list - most likely due to circular dependencies involving OgMigrateContent,OgMigrateUser,OgUiMigrateAddField,OgUiSetRoles". I tried to "migrate-deregister" the offending migrate tasks, but to no avail. Reversing this patch was the only solution I found.
Please reverse this patch in the next release candidate, or fix the edge case where someone has already run the og migrations with an earlier beta.
Comment #12
amitaibu> Please reverse this patch in the next release candidate, or fix the edge case where someone has already run the og migrations with an earlier beta.
How about a patch to help -- maybe you can write the hok_update_N() to de-register the migrate plugins?
Comment #13
arosboro CreditAttribution: arosboro commentedany word on a patch here? I ran migrate using the beta2 of og
Comment #14
danylevskyiI had some experiments with this bug today. Adding
if
statements to class definitions fixes this issue. But! Another very weird issue appears. See this: #1814264: Custom migration classes confused by default og-to-og migration classes: Base table or view not found: 1146 Table 'd6_og'.Comment #15
danylevskyiAmitaibu, my proposal is to move migration classes for OG content updating into separate submodule. This is roadmap:
Amitaibu, I am ready to prepare patch. What do you think about this proposal?
Comment #16
amitaibu> Amitaibu, I am ready to prepare patch
Much appreciated!
I'd like to better understans -- Wouldn't 3 be enough, i.e. de-register classes on hook_update_N() so later users can re-register them?
Also I'm still not clear what is the benefit of another module.
Comment #17
danylevskyiNow we have a problem on fresh install with migration classes for updating content #1869052: drush mi: Failure to sort migration list.
To fix this problem we can add
if
statements before classes to check if migration is needed. But these statements create another problem #1814264: Custom migration classes confused by default og-to-og migration classes: Base table or view not found: 1146 Table 'd6_og'. We got something like circle :)Our goal is to include migration classes only if we need to make content migration (while updating from one version to another). Additional submodule will fix this problem. It can be enabled or disabled if needed.
Yes, it's enough. After enabling "og_migrate_data" module classes will be registered automatically.
Comment #18
amitaibu> Our goal is to include migration classes only if we need to make content migration
But I already have an
IF
for registration of migrations handlers inside OG / OG-UIIt dosen't do any dis-registration -- is that the problem?
What I'm thinking is that we can de-register all the migrate classes, and let the user re-register them via the Migrate UI/Drush.
Comment #19
amitaibu> But these statements create another problem #1814264: Custom migration classes confused by default og-to-og migration classes: Base table or view not found: 1146 Table 'd6_og'. We got something like circle :)
I think the question is if using migrate 2.5 VS 2.4. The 2.4 will register it no matter what. If using the latest recommended version wrong migrates won't be registered.
Comment #20
danylevskyiWow! New information. Problem raises only after calling
migrate_autoregister()
function. Migrate 2.5.Try to run
drush mar
and go to/admin/content/migrate
.Comment #21
amitaibuCan you please check -- if you set variable_set('migrate_disable_autoregistration', TRUE) -- and then enable OG I would assume it won't crash, because the handlers won't be registered.
Comment #22
danylevskyiFresh install. Migrate 2.5. After installing OG all works great.
After
drush mar
OG crashes regardless ofmigrate_disable_autoregistration
variable.Comment #23
amitaibu@mikeryan , I've Moved the issue to Migrate, as I'm not clear if it's an OG or Migrate bug.
Seems that Migrate is registration classes it should not register. Any chance you can have a look?
Comment #24
mikeryanSounds like there are multiple problems here - a WSOD and a "circular dependencies" error? The latter can indicate, besides circular dependencies, a class that's not defined, so make sure all the classes being registered in hook_migrate_api() are in fact defined, in .inc files that are referenced in the appropriate .info file. On that score, pulling the current -dev of og, I see og.info references a couple of non-existent files in includes/migrate/7200, og_ogur*. Actually the opposite of what's being reported, but it would be worth auditing to make sure there's a one-to-one correspondence between the .inc files and the files[] listed in .info.
Comment #25
alesr CreditAttribution: alesr commentedI got this "circular dependancies" error today when trying to migrate from OG 7.1 to 7.2. (Migrate 7.x-2.x-dev+30, OG 7.x-2.0-rc2)
After debugging I focused on line 90 in migrate.module where $ready = FALSE is set..
Commenting $ready = FALSE; solves the WSOD problem. Still get those errors on admin/content/migrate page but maybe it can help us out solving the problem...
Comment #26
amitaibuThanks @mikeryan for going over this!
I've deleted the obsolete classes from the info file.
In this patch I've moved the register into the
hook_migrate_api()
-- @danylevskyi can you test is please?Comment #27
amitaibuAnd the patch :)
Comment #28
amitaibuI've committed the patch, as Migrate test passed locally. Please re-open if still not solved, or better -- confirm with comment it's ok, as this is a release blocker.
Comment #29
torrance123 CreditAttribution: torrance123 commentedI'm using rc3 and have confirmed that the patch in #27 is included in this release (as attempting to apply the patch fails with "Reversed (or previously applied) patch detected!").
I'm still getting the following error when I attempt to access either
/admin/content/migrate
or when attempting to manually register migrations:MigrateException: Failure to sort migration list - most likely due to circular dependencies involving OgMigrateContent,OgMigrateUser,OgUiMigrateAddField,OgUiSetRoles in migrate_migrations() (line 80 of sites/all/modules/migrate/migrate.module).
Setting back to open and to critical since this is a release blocker.
Edit: to be clear, I'm encountering this issue whilst trying to upgrade from 1.x to 2.x following the instructions here.
Comment #30
danylevskyiOn fresh install after
drush mar
Migrate/OG still crashes.Comment #31
amitaibu> or when attempting to manually register
> On fresh install after drush mar Migrate/OG still crashes.
using
drush mar
or manual registration is wrong -- as it registers handlers that are not defined in hook_migrate_api(), thus overrides al out IF logic in og_migrate_api(). IMO, having this button is wrong and probably meant for backward compatibilityComment #32
torrance123 CreditAttribution: torrance123 commentedOK, so the instructions here which specify to perform a manual registration are clearly wrong then.
I was able to resolve this by going to the db table
migrate_status
and deleting all the og migration records from here. I then cleared the cache and revisitedadmin/content/migrate
. This then inserted only 3 migrations into themigrate_status
table (previously there had been 6) and avoided any conflicts.My migrations are running now.
Comment #33
amitaibuCool - maybe you can fix the doc and improve it for others? :)
Comment #34
amitaibuI've updated the docs myself, so closing.