Skip to content

Instantly share code, notes, and snippets.

View mlutfy's full-sized avatar

Mathieu Lu mlutfy

View GitHub Profile
@mlutfy
mlutfy / civi-rebuild-multilingual.sh
Last active April 24, 2024 13:04
CiviCRM: rebuild multilingual views
# Drupal 7
drush php-eval 'civicrm_initialize(); CRM_Core_I18n_Schema::rebuildMultilingualSchema(["en_US","fr_CA"], NULL);'
# Drupal 8
drush php-eval '\Drupal::service('civicrm')->initialize(); CRM_Core_I18n_Schema::rebuildMultilingualSchema(["en_US","fr_CA"], NULL);'
# WordPress
wp eval 'civicrm_initialize(); CRM_Core_I18n_Schema::rebuildMultilingualSchema(["en_US","fr_CA"], NULL);'
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 December 7, 2018 21:32
Ansible role for batch migrating sites with hosting_remote_import
---
# 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 18:38
civicrm-css-community-messages.css
/**
* 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 April 15, 2018 19:18
gitlab notes
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
@mlutfy
mlutfy / civi-tax.patch
Created January 12, 2018 17:41
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
@mlutfy
mlutfy / civi-multi-lingual.txt
Created January 5, 2018 18:33
civi multi-lingual
```
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;
@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;
}
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);