Skip to content

Instantly share code, notes, and snippets.

Mathieu Lu mlutfy

Block or report user

Report or block mlutfy

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View logging.patch
diff --git a/CRM/Core/I18n/Schema.php b/CRM/Core/I18n/Schema.php
index 64cb94b0..19dd15f7 100644
--- a/CRM/Core/I18n/Schema.php
+++ b/CRM/Core/I18n/Schema.php
@@ -342,9 +342,15 @@ class CRM_Core_I18n_Schema {
}
// rebuild views
+ $config = CRM_Core_Config::singleton();
+
@mlutfy
mlutfy / main.yml
Created Dec 7, 2018
Ansible role for batch migrating sites with hosting_remote_import
View main.yml
---
# server_XXXX is the remote server
# server_YYYY is the database server
# platform_civicrm is the alias for my platform
# The names can be found by going in the Aegir front-end, in the URL alias, or from ~/.drush/server[...].
- name: Run Aegir's remote-import
shell: "drush --backend=2 @server_XXXX provision-remote_import --old_url={{ inventory_hostname }} --new_url={{ inventory_hostname }} --platform=platform_civicrm --db_server=server_YYYY"
delegate_to: localhost
tags:
@mlutfy
mlutfy / gist:0c2bf58bc1ff1984b673d6b3f1c7e9ee
Created May 10, 2018
civicrm-css-community-messages.css
View gist:0c2bf58bc1ff1984b673d6b3f1c7e9ee
/**
* Community messages
*/
.crm-container .civicrm-community-messages,
.crm-container .civicrm-community-messages .collapsible-title,
.crm-container .civicrm-community-messages .collapsible-title:hover,
.crm-container .civicrm-community-messages .collapsible-title > div {
border: none;
background-color: #defabb;
background-image: none !important;
@mlutfy
mlutfy / gitlab-notes.md
Last active Apr 15, 2018
gitlab notes
View gitlab-notes.md
View icinga-drupalversion.conf
object Host "abc.symbiotic.coop" {
import "generic-host"
groups = [ "icinga-satellites", "aegir-servers", "nginx-servers", "ovh-servers" ]
check_command = "ping"
address = "[...]"
address6 = "[...]"
vars.civicrm["crm.symbiotic.coop"] = { cms = "drupal" }
vars.civicrm["www.symbiotic.coop"] = { cms = "drupal" }
// etc
View civi-tax.patch
diff --git a/wp-content/plugins/civicrm/civicrm/CRM/Contribute/BAO/Contribution.php b/wp-content/plugins/civicrm/civicrm/CRM/Contribute/BAO/Contribution.php
index 9b6f189..bc038f8 100644
--- a/wp-content/plugins/civicrm/civicrm/CRM/Contribute/BAO/Contribution.php
+++ b/wp-content/plugins/civicrm/civicrm/CRM/Contribute/BAO/Contribution.php
@@ -103,6 +103,7 @@ class CRM_Contribute_BAO_Contribution extends CRM_Contribute_DAO_Contribution {
if (empty($params)) {
return NULL;
}
+
//per http://wiki.civicrm.org/confluence/display/CRM/Database+layer we are moving away from $ids array
View civi-multi-lingual.txt
```
MariaDB [testi18n2symbiot]> select * from civicrm_setting;
+----+--------------------------+------------------------------------------------------------------------------------------------------------+-----------+------------+-----------+--------------+---------------------+------------+
| id | name | value | domain_id | contact_id | is_domain | component_id | created_date | created_id |
+----+--------------------------+------------------------------------------------------------------------------------------------------------+-----------+------------+-----------+--------------+---------------------+------------+
| 1 | resCacheCode | s:5:"ZxpgU"; | 1 | NULL | 1 | NULL | 2018-01-05 13:18:20 | NULL |
| 2 | installed | i:1;
View gitlab-print.css
@namespace url(http://www.w3.org/1999/xhtml);
/* based on : https://gitlab.com/gitlab-org/gitlab-ce/issues/23465 */
@media print {
/* fix firefox print internal error (https://bugzilla.mozilla.org/show_bug.cgi?id=1308516) */
html.turbolinks-progress-bar::before {
display: none !important;
}
View CRM_Member_Form.patch
protected function setPriceSetParameters($formValues) {
$this->_priceSetId = self::getPriceSetID($formValues);
$priceSetDetails = self::getPriceSetDetails($formValues);
$this->_priceSet = $priceSetDetails[$this->_priceSetId];
// Call the buildAmount hook again to support extensions such as
// cdntaxcalculator, otherwise we cannot customize tax calculations.
// Setting the priceSetId this way is required by some extensions
// such as CiviDiscount.
$this->set('priceSetId', $this->_priceSetId);
View cdntax-example-hook-implementation.patch
/**
* Implements hook_civicrm_alterPriceSet().
*/
function cdntaxcalculator_civicrm_alterPriceSet($formName, &$form, &$priceset) {
if ($formName == 'CRM_Member_Form_Membership') {
$contact_id = $form->_contactID;
$taxes = CRM_Cdntaxcalculator_BAO_CDNTaxes::getTaxesForContact($contact_id);
CRM_Cdntaxcalculator_BAO_CDNTaxes::applyTaxesToPriceset($priceset['fields'], $taxes);
}
}
You can’t perform that action at this time.