Drupal 10, the latest version of the open-source digital experience platform with even more features, is here.I've been updating provision_civicrm recently, and added a service so that we can save data into the site context (alias/entity...) from a new hosting_civicrm module. I was trying to model it on the pull request for 'Aegir HTTP basic authentication' as listed here: http://community.aegirproject.org/contrib-modules. To my knowledge, it's the only contrib extension that both:
- purports to support Aegir 2.x, and
- implements a service
I wasn't able to get the extension in the repo from which that pull request originated to work, nor was I successful in implementing a service in 2.x myself. Once I switched back to 1.x, I had something running relatively quickly. While there's documentation in our example.drush.inc, I wasn't able to implement it, despite about a day of banging my head against it.
I'm marking as a critical bug right now, as I think it's crucial that we support our contrib community in porting their modules/extesnions. So, IMO, this is a release blocker.










Comments
Comment #1
ergonlogicHalf the problem was #1987026: drushrc.php no longer read from Drupal root in Drush 5 which, in the case of provision_civicrm, meant we weren't ever having our code triggered. With that solved, the changes required to support class auto-loading became clearer. I've documented them here: http://community.aegirproject.org/upgrading/path#Class_auto-loading. This needs a technical review, as it's still pretty new to me. In addition, I'm not sure it's appropriate for that page, which is focused more on providing guidance to administrators upgrading their Aegir install, rather than developers porting their extensions. Perhaps a sub-page is in order, or perhaps a new page in the Developer's Guide (which itself should probably be revised and updated).
Comment #2
ergonlogicHalf the problem was #1987026: drushrc.php no longer read from Drupal root in Drush 5 which, in the case of provision_civicrm, meant we weren't ever having our code triggered. With that solved, the changes required to support class auto-loading became clearer. I've documented them here: http://community.aegirproject.org/upgrading/path#Class_auto-loading. This needs a technical review, as it's still pretty new to me. In addition, I'm not sure it's appropriate for that page, which is focused more on providing guidance to administrators upgrading their Aegir install, rather than developers porting their extensions. Perhaps a sub-page is in order, or perhaps a new page in the Developer's Guide (which itself should probably be revised and updated).
Comment #3
anarcat CreditAttribution: anarcat commentedWell, there are two issues here: providing guidance for services, and whether or not there should be a separate page for porters. :)
I agree it may be time to split into a separate page, but in the meantime, your stuff looks great. Maybe this should be reviewed by darthsteven, and not me however.
Comment #4
ergonlogicI'm continuing to work through this with hosting_/provision_civicrm, and it appears that what I've documented so far isn't sufficient. While it'll write values from the front-end into the site alias, it won't necessarily be available through
d(). In particular, I'm seeing this in adrush_hook_post_provision_install(). I've had to addd()->init();early in the hook implementation, andoption_documentation()methods to the classes, like so:Both appear to be required, but I'm at a bit of a loss to explain it. I haven't implemented an
init()method in my classes, so I guess it's using the parent'sinit(), which in the case ofProvision_Service, doesn't appear to do anything: http://api.aegirproject.org/api/Provision/Provision--Service.php/functio....Is it maybe triggering the
__construct()method on the parent? I have to admit I don't really understand what's going on here.Comment #5
Steven Jones CreditAttribution: Steven Jones commentedWhatever is going on, I think we need to make it easier on other extensions to integrate with Provision, there's too much code here.
Comment #6
helmo CreditAttribution: helmo commentedA child page under http://community.aegirproject.org/contrib explaining this would help :)
#1984098: Aegir 2.x compatibility would also benefit from this.
Comment #7
helmo CreditAttribution: helmo commentedI've moved the bulk of http://community.aegirproject.org/upgrading/path#Class_auto-loading to a new page http://community.aegirproject.org/content/contrib/class-auto-loading
Does the example module in provision need any updates from this?
Comment #8
ergonlogicWith #7 and the inclusion of #2103173: Provide an example of saving data to a site context, I think we can close this issue.