I just ran across this error when attempting to migrate my Ubercart site to Commerce.
Module Versions:
Drupal core: 7.26
Commerce Kickstart: 7.x-2.12
Migrate: 7.x-2.5 [ISSUE: this module is made to work with migrate 7.x-2.6]
Commerce Migrate: 7.x-1.1
Commerce Migrate Ubercart: 7.x-2.0
Steps to Reproduce:
- Set Up a Drupal 6 Ubercart site to serve as the migration source
- Follow the Installation guide for Commerce Kickstart to set up a brand new store
- Configure the settings.php file to inform Commerce Migrate about the Ubercart site's database:
$databases = array ( 'default' => array ( 'default' => array ( 'database' => 'example.com_commerce', 'username' => 'root', 'password' => 'drupalpro', 'host' => 'localhost', 'port' => '', 'driver' => 'mysql', 'prefix' => '', ), ), 'ubercart' => array( 'default' => array( 'database' => 'example.com_ubercart', 'username' => 'root', 'password' => 'drupalpro', 'host' => 'localhost', 'port' => '', 'driver' => 'mysql', 'prefix' => '', ), ), ); - Download and Install Commerce Migrate Ubercart
- Navigate to CMU Configuration page: Content -> Migrate -> Configure Ubercart Migration (admin/content/migrate/ubercart_migration_options)
- Configure with the following options:
- Source database key: ubercart
- Source Database Drupal Major version: Drupal 6
- Default filter format: Full HTML
- Map User ownership: No
- Commerce customer profile type: Billing Info
- Click "Save configuration"
Expected Outcome
The configuration options are saved and I can migrate from the Ubercart site.
Actual Outcome
There is a "White Screen of Death" with the error message about the migrate_static_registration function. Full text:
Fatal error: Call to undefined function migrate_static_registration() in /home/drupalpro/websites/commerce.example.com/sites/all/modules/commerce_migrate_ubercart/commerce_migrate_ubercart.module on line 115 Call Stack: 0.0003 341908 1. {main}() /home/drupalpro/websites/commerce.example.com/index.php:0 0.4354 36778320 2. menu_execute_active_handler() /home/drupalpro/websites/commerce.example.com/index.php:33 0.4355 36779012 3. call_user_func_array() /home/drupalpro/websites/commerce.example.com/includes/menu.inc:517 0.4355 36779264 4. drupal_get_form() /home/drupalpro/websites/commerce.example.com/includes/menu.inc:0 0.4356 36779892 5. drupal_build_form() /home/drupalpro/websites/commerce.example.com/includes/form.inc:131 0.4451 37153744 6. drupal_process_form() /home/drupalpro/websites/commerce.example.com/includes/form.inc:380 0.4490 37200404 7. drupal_validate_form() /home/drupalpro/websites/commerce.example.com/includes/form.inc:854 0.4492 37200892 8. _form_validate() /home/drupalpro/websites/commerce.example.com/includes/form.inc:1148 0.4513 37202952 9. form_execute_handlers() /home/drupalpro/websites/commerce.example.com/includes/form.inc:1418 0.4513 37205748 10. commerce_migrate_ubercart_admin_form_validate() /home/drupalpro/websites/commerce.example.com/includes/form.inc:1478
Some basic research indicated that this particular function should be provided by the Migrate module, which is installed and enabled on my site. It seems that the Migrate module's api must have changed slightly rendering the Commerce Migrate Ubercart module out of date.
Reproducible
Every Time
Severity
Fatal
Solution: install migrate 2.6 first, as instructed on module description page.
Or to fix it (assuming you are using migrate 2.6) : clear your cache, go to content>migrate>configuration and click "register statically defined migrations". Please read the readme file and the module description page.
Comments
Comment #1
seismicmike commentedComment #2
docans commentedI am also getting this issue and i can do anything else
When i checked this is what i saw on that line.
What is going on
Comment #3
Anonymous (not verified) commentedInteresting. Try using migrate 2.6 branch. You should check the project page for the recommended versions. You may have to click the "releases" link on the migrate page to find the exact one.
Did you by chance enable this module before migrate was installed? If so, you could also try clearing the cache when you hit this stage and then reload this page. Try enabling migrate first by itself, then enable this module. I think that might do the trick, I've used that method for scripted migrations and they usually have no troubles with registration.
Edit: thanks for the very detailed report. I'll probably rework the setup process at some point in the future if the proposed workaround solves this.
Comment #4
docans commentedThanks so much for your support. I will enable migrate first before enabling the commerce migrate ubercart module. After i will try and import it. If it does not work i will download version 2.6 and do the same and see if it works. Does the commerce migrate ubercart also move taxonomy and custom fields created in the product node?
Comment #5
docans commentedHi
When i tried to import with the migrate version 2.6 rc i got his error
Comment #6
Anonymous (not verified) commentedI was not aware that commerce_kickstart had some migrate stuff in there. This suggests that that code code could be written for migrate 2.4, which *might* work in 2.5 as it supported both methodologies.
Is the path to migration.inc in your post where YOU installed migrate? If not, you might have two copies of that.
If you are running two copies of migrate, remove one. If you still have the first error, consider editing the commerce_kickstart_product.info file and removing commerce_kickstart_product.migrate.inc, then clear the caches.
It sounds like these things are probably unrelated to this module specifically. I'm now curious to go look at commerce_kickstart to see what migrate stuff they are doing with it, I know others have used it with this module as one of our 2.x branch testers was using it. So it should be possible.
Comment #7
torgospizzaI ran into this error too. It looks like there are a couple options:
1. Commerce Kickstart could include Migrate 2.6 (the error in #5 points to a Warning that this particular migration class was not updated with the new Migrate requirements). This is pretty feasible.
2. In the Date Migration Unit Tests (class "DateMigrateExampleUnitTest" in the setUp function) they use this bit of test to ensure compatibility:
This looks like it might also be useful to plug into places where the new migrate_static_registration() function is used, as there does appear to be a BAC layer thought of and implemented in some of these Unit Tests.
Comment #8
Anonymous (not verified) commented@torgosPizza thanks for this. This will come in handy when I revise the registrations. Still not sure when I'm going to schedule that out, probably when I have my next paid gig to migrate UC->commerce underway.
Comment #9
Anonymous (not verified) commentedFor now I have just posted install instructions to the module description page. If someone wants to roll a patch with this code, I'm all for it. I will review it and give you attribution for it if you follow the patching instructions.
For the time being I don't have any active projects that have a dire need for this. You can just install migrate first and there will be no issue. Likewise, if you clear the caches and then click the button to re-register statically defined migrations on migrate's config page you'll be able to get around the issue anyway.
Please change the status from "postponed" to "needs review" if/when you post a patch.
Comment #10
Anonymous (not verified) commentedAdjusting the priority to reflect that the module works when the install instructions are followed and it is fully recoverable if they are skipped. It would be a good idea to report issues with other modules on their respective issue pages.
Comment #11
etron770 commentedSame Problem here.
New Commerce guys installation without demo shop
installed and enabled Commerce Migrate Ubercart and enabled Migrate UI
-> admin/content/migrate/ubercart_migration_options -> save configuration
Error:
PHP Fatal error: Call to undefined function migrate_static_registration() in /var/www/..../sites/all/modules/commerce_migrate_ubercart/commerce_migrate_ubercart.module on line 115, referer: http://maydomain.com/admin/content/migrate/ubercart_migration_optionsadditionally I found:
this could be because the ubercart database could not be set in admin/content/migrate/ubercart_migration_options
Comment #12
Anonymous (not verified) commentedRegarding "Status message
commerce_kickstart_merchandising_migrate_api supports Migrate API version , Migrate module API version is 2 - migration support not loaded." :
You simply can't mix the old and the new versions of migrate. It appears commerce kickstart has included some migrations that use the old format.
It might be worth trying migrate 2.5, as it supports both old and new registration system (though I am not sure how much will work as I have not tested it against 2.5 in a LONG time).On second thought I don't recommend this. You should be fine on migrate 2.6 for any migrations in this module.It would be a better idea to go to the module that is out-of-date and have them update it to use the latest code. From what I see here, you want to take this bug up with the maintainer of commerce_kickstart_merchandising_migrate_api.
For those who haven't been following migrate for the past year or two:
2.4 = "auto-registration" - had many issues and conflicts with other modules
2.5 = "auto-registration" OR "static registration" - static uses the nice registration array
2.6 = "static registration" only.
Comment #13
jon pollard commentedI've been messing around with this for a couple of days now using commerce kickstart and various versions of migrate/commerce migrate ubercart. I've just had a small amount of success with the 7.x-1.x-dev version - I've installed the module and got some bits to work, so far I've imported billing and order details... and even products! It's a bit of a mess, but it looks like a more up to date version of would be great!
It's been a frustrating experience and it looks like it's down to the way kickstart is set up. So, my question is - would it be possible to take a kickstart instance and update it to be in a state that will play nicely with 'commerce migrate ubercart'? Remove/update/configure some modules?
Or is the answer to not use kickstart?
Comment #14
etron770 commented7.x-1.x-dev version from what?
or better can you give us a hint how to setup a basic system to migrate from ubercart and maybe update later?
Comment #15
rhip commentedI'm having the same issue with Commerce Kickstart 7.x-2.15 .
Fatal error: Call to undefined function migrate_static_registration() in /sites/all/modules/commerce_migrate_ubercart/commerce_migrate_ubercart.module on line 115
Tried removing the Migrate module from /profiles/commerce_kickstart/modules/contrib and puting the latest version of Migrate (7.x-2.5) in /sites/all/modules but same error.
I see it's been raised on drupalcommerce.org: http://www.drupalcommerce.org/search/site/migrate_static_registration%28%29
Comment #16
Anonymous (not verified) commentedPlease follow the installation instructions and read the entire module description page to get this module setup.
You will have to install migrate BEFORE this module if you are seeing "Call to undefined function migrate_static_registration()." If you see that error and don't want to uninstall, just clear the cache, go to migrate>config and "register statically defined migrations". That's it.
If you are getting an error with "Warning: Missing argument 1 for DynamicMigration::__construct()" please take it up with the commerce_kickstart project as that warning indicates there is old code in one of your other modules. It shouldn't have any effect on the migrations in this module.
Comment #17
Anonymous (not verified) commentedComment #18
etron770 commentedgo to migrate>config and "register statically defined migrations".
can you give me the link for that, like admin/migrate/config
maybe it is another reason but at admin/content/migrate:
CommerceMigrateUbercartProduct: Total rows has zero rows at admin/content/migrate
Comment #19
rhip commentedMigrate was installed before commerce migrate ubercart but I still got "Fatal error: Call to undefined function migrate_static_registration()".
I did uninstall it, flush the cache/run cron about 5 times (OCD?) and then reinstall it. I still get the error.
Tried to navigate to admin/content/migrate/configure to register statically defined migrations but get: "MigrateException: No migration found with machine name configure in MigrationBase::getInstance() (line 444 of /profiles/commerce_kickstart/modules/contrib/migrate/includes/base.inc).".
I'm going to delete the entire site and start all over again with a fresh kickstarter install.
I'm sure it's a kickstarter issue - not a migrate issue really so taking it across to the commerce forums instead now: http://www.drupalcommerce.org/search/site/migrate_static_registration%28%29Comment #20
etron770 commentedI did a fresh install of Drupal, and Commerce Migrate Ubercart (only enabled this module with all other required modules automatically) nothing else.
with admin/content/migrate/configure
I get the same message - so it seems that it is no kickstart issue
Additionally:
I started this tread on http://www.drupalcommerce.org but afterwards I realized that there are more unanswered treads as answered ...
Comment #21
rhip commentedI've just done a new, fresh install (using Commerce Kickstart) this includes the Migrate module. I still get "Fatal error: Call to undefined function migrate_static_registration() in /sites/all/modules/commerce_migrate_ubercart/commerce_migrate_ubercart.module on line 115".
Call to a member function getName()
Now when I navigate to admin/content/migrate I also get "Fatal error: Call to a member function getName() on a non-object in /profiles/commerce_kickstart/modules/contrib/migrate/migrate.module on line 113". If I uninstall Commerce Migrate Ubercart it goes away.
Not sure where to go from here as neither of the suggested solutions: https://www.drupal.org/node/2187251/revisions/view/7391363/7391369 seem to work. I had installed Migrate module first (as per the instructions) and there is no option I can see here to /admin/content/migrate/registration "register statically defined migrations".
Just dropped the database and going to start again.
Modules enabled by default in Kickstart:
I have tried uninstalling all of them and reinstalling them (with migrate first) but still get the error. This really is a fatal error with no obvious solution. Something must have changed since the solution was suggested a few months ago. I'm going to start a new thread as this is a fresh error.
Comment #22
etron770 commentedgot a commerce (no kickstart) partially installation working
with
commerce_migrate-7.x-1.x-dev.tar.gz
commerce_migrate_ubercart-7.x-2.x-dev.tar.gz
»commerce_migrate_ubercart-7.x-2.x-dev.tar.gz
the products are not importet well but no exception error
Now I will try the kickstart
Comment #23
rhip commentedThank you etron770, have you found a place to "register statically defined migrations"? I can't find anywhere to do that and there is no documentation I can find.
Comment #24
etron770 commentedAs I know there is only register statically defined migrations available in migrate 2.6 so there is no page to choose it.
fyi: I will stop to try the ubercart migration. I have only one site left to migrate and the owner decided to reorganize his store.
So most of the goods need not to be imported. Its not worth for me to use time for trying ubercart migration. I will do the rest manually.
Good luck for you
Comment #25
jon pollard commentedI have to say that I am also giving up on this. After many days trying to get this working with various combinations of commerce, commerce kickstart and module versions the best I have got is an import of product titles. Commerce Guys are promoting this system as a solution - maybe they should invest some time into documentation?
Comment #26
rhip commentedThank you for the update. I am putting my project to one side (I have nearly 2 thousand products in my store so I would need a migrate option to move away from Ubercart and onto Commerce). It's a shame it isn't working any more as it looked like it was a great module - and actually very easy to use in the screencasts! I am hoping that at some point Commerce Guys will have another look and fix it. Until then it's back to Ubercart for me...
Good luck to you guys too.
Comment #27
jon pollard commentedBill, have you looked at commerce feeds? It's great for import/export of products and users if fiddly. It looks like it can't handle orders though, which is a shame.
Comment #28
Anonymous (not verified) commentedSorry to hear you guys are having so much trouble with this.
The module is designed to work with migrate 2.6 as others have noted.
Commerce Kickstart includes a migration that is not compatible with 2.6, however, it can probably be ignored without any issues.
If anyone wants to contact me to review a specific implementation I can be contacted for paid consulting work. I do not work for Commerce Guys. I have just made my updates available to the community at-large after having rewritten parts of this module to support my own projects.
Comment #29
Anonymous (not verified) commentedComment #30
Anonymous (not verified) commentedBTW, everyone using Kickstart...
This module is meant to work generically with Ubercart to Commerce. While we were developing the 2.x branch someone did some tests for us to get it working with Kickstart. The main issue was just mapping out the name of the product_display type and the associated product refrence field. That is, as far as I know, the only structural difference and I believe it was taken care of.
All of the issues here seem to be related to *registering* the migrations, which needs the migrate 2.6 registration system to be available to it (as described on the module page and further in the readme).
As mentioned previously, Commerce Kickstart also includes a template for an older-style migration. That won't be usable in this context. You can either ignore the message, or if it causes you trouble, try to remove it from Kickstart somehow.
Comment #31
rhip commentedThank you Ryan Weal. Migrate 2.6 solves this problem and does not throw up the static registration error with Kickstart.
It does give this instead:
"Passing an empty first parameter to a migration constructor is now deprecated - pass through the arguments array passed to the leaf class instead."
Then finally these when the import is run:
<-- renamed migrate_status table machine names appropriately to fix."No migration found with machine name CommerceMigrateUbercartNAMEOFPRODUCTYPE."
"MigrateException: Failure to sort migration list - most likely due to circular dependencies involving CommerceMigrateUbercartNodeBooks,CommerceMigrateUbercartNodeproducts,CommerceMigrateUbercartNodehealth,CommerceMigrateUbercartNodeWine in migrate_migrations() (line 82 of /profiles/commerce_kickstart/modules/contrib/migrate/migrate.module)."
But I guess this is now for a different thread ;)
The problem on this thread is solved by Migrate 2.6.
Comment #32
suntower commentedHi,
I am evaluating Kickstart 2. I got the above error. I cleared the cache and then got the getname() error. I followed the advice in this topic and updated Migrate to 7.26RC1 and now I'm getting the following error whenever I try to access any part of Migrate:
PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'simulab1_commerce.migrate_group' doesn't exist: SELECT mg.name AS name, mg.title AS title, mg.arguments AS arguments FROM {migrate_group} mg; Array ( ) in migrate_ui_migrate_dashboard() (line 29 of /home/simulab1/public_html/profiles/commerce_kickstart/modules/contrib/migrate/migrate_ui/migrate_ui.pages.inc).
Any ideas?
Comment #33
shaneonabike commentedHey
I had this problem also BUT after reading here that MIgrate 2.6 and registering the statically defined classes it's fine for me (I'm not using Kickstarter)
Please please could add this to the install frontpage instructions. I think that my eleviate lots of issues for folks...
Basically I would change...
To...
Comment #34
suntower commentedWRT #33 @ShaneOnABike:
After I got the PDOException error I reported in #32, I read your reply and had some hope. So I made sure I -do- have Migrate 2.6RC1 installed (I do). I cleared all caches and then returned to /admin/content/migrate/configure and clicked on Register statically-defined classes.
And then I get the PDOException error again.
Now what? Should I basically uninstall ALL Migrate modules and try to start over again? This is worrying, obviously, I will need this to work reliably when we want to do a 'real' migrate.
Comment #35
dwkitchen commentedLooks like this has been covered on the install instructions now