Closed (fixed)
Project:
Provision CiviCRM
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
17 Sep 2011 at 04:23 UTC
Updated:
13 Nov 2011 at 15:30 UTC
Jump to comment: Most recent file
Comments
Comment #1
bgm commentedRelated to #955018: ability to save new arbitrary data to a context from outside the service
Comment #2
j0nathan commentedSubscribing.
Comment #3
sfyn commentedOne possibility to work around the limitations of #955018: ability to save new arbitrary data to a context from outside the service:
Write to a seperate file (call it provision.civicrm.settings.php) with the missing data - then we just need to make sure this file is bootstrapped to provide the civicrm data instead of the drushrc - we lose the dependancy on drushrc.
Comment #4
sfyn commentedFun fact, during my tests today I have noticed that the $options['civicrm_sitekey'] and the $options['site_civicrm'] are conserved through migration, but appear at the bottom of the drushrc.php file instead of at the top - just before the block assigning $options to the $_SERVER superglobal.
I think this happens because at line 82 of drush_civicrm_post_provision_verify you set the sitekey again.
Comment #5
sfyn commentedI have been attempting to pass these values, and have had some success.
The problem is that when drushrc is written for the site, the values don't get written. So, uh, wuh? Just wanted to make sure others could see what I have tried to do on this.
Comment #6
sfyn commentedI have a working patch for this functionality.
What I did was look at how the migrate function does it's business, and made use of provision_backend_invoke to invoke an additional verify after the migration completes to reinstate the values that will have been lost in the meantime. This is possible because the post_provision_migrate and pre_provision_migrate hooks occupy the same drush context.
Comment #7
sfyn commentedI have also documented my approach in #955018: ability to save new arbitrary data to a context from outside the service
Comment #8
sfyn commentedHere's a better patch that also addresses some of the code this makes redundant in the verify hooks.
Comment #9
sfyn commentedOK, here is the patch I think we should use. I was able to remove about 10 lines of unnecessary code.
Comment #10
bgm commentedImpressive, thank you!
Tested and committed to 6.x-1.x.