I've created a patch to add support to the import of Ubercart Roles. The patch will do the following:

  • Add Ubercart Roles expiration date (for each Ubercart role) as a field match option
  • Add Ubercart Roles import options:
    • Extend only
      If user has existing expiration, only overwrite expiry date if the new period is longer than the existing one. (This is only applicable if 'Update Existing Users' is set as 'Replace Data'.)
    • Send email
      Send email to users when they get a new or updated role expiration. This will use the email message in the import configuration

In short, it allows the import of a date field (eg. 1 January 2012) and will allow administrators running the import to match the field with a ubercart role. The only code changes are in the addition of a new uc_roles.inc file in the /supported subdirectory.

I'll attach the patch shortly.

Comments

victoriachan’s picture

Here is the patch

victoriachan’s picture

Sorry, a small bug with the previous patch. I've amended it now.

victoriachan’s picture

Updated drupal_set_message to make string cleaner. Sorry, I promise to stop fiddling!

robert castelo’s picture

Status: Active » Needs review

Thanks for the patch, feel welcome to fiddle with it as much as you want :-)

I'll try and review as soon as I can, currently putting most of my time into a D7 release of User Import.

gisle’s picture

Version: 6.x-4.1 » 7.x-3.x-dev
Issue summary: View changes
Status: Needs review » Needs work

IMHO. this is not the correct way to add support for a contributed module.

To take care of this, implement hook_field_user_import_supported_alter() in the Ubercart module.

I believe that this project should not be bloated with code to support various contributed modules - that code need to go into the project where it belongs. The hook will make the field supported by this project.

However, if Roberto Castelo disagrees and want to review this patch and eventually commit it to User Import, that's his prerogative.

However, the Drupal 6 branch is no longer supported, so needs to be rerolled for the latest development snapshot (7.x-3.x-dev). For this reason, I am setting status to "needs work".