Skip to content

Instantly share code, notes, and snippets.

View jitendrapurohit's full-sized avatar

Jitendra Purohit jitendrapurohit

View GitHub Profile
diff --git a/components/com_civicrm/civicrm.php b/components/com_civicrm/civicrm.php
index 73bf821ae4..3381c99a19 100644
--- a/components/com_civicrm/civicrm.php
+++ b/components/com_civicrm/civicrm.php
@@ -5,6 +5,8 @@
defined('_JEXEC') or die('No direct access allowed');
+use Joomla\CMS\Factory;
+
diff --git a/ext/search_kit/ang/crmSearchAdmin/displays/searchAdminDisplayTable.html b/ext/search_kit/ang/crmSearchAdmin/displays/searchAdminDisplayTable.html
index e2220662f6..b4bd2be0d4 100644
--- a/ext/search_kit/ang/crmSearchAdmin/displays/searchAdminDisplayTable.html
+++ b/ext/search_kit/ang/crmSearchAdmin/displays/searchAdminDisplayTable.html
@@ -29,7 +29,15 @@
<search-admin-css-rules label="{{:: ts('Row Style') }}" item="$ctrl.display.settings"></search-admin-css-rules>
<search-admin-pager-config display="$ctrl.display"></search-admin-pager-config>
<search-admin-placeholder-config display="$ctrl.display"></search-admin-placeholder-config>
- <div class="form-inline crm-search-admin-flex-row" title="{{:: ts('Text to display if the table is empty.') }}">
+ <div class="form-inline">
@jitendrapurohit
jitendrapurohit / webform_migrate_number_field.diff
Created October 21, 2023 06:49
Fix required to migrate number field on d7 webform with select options.
diff --git a/src/Plugin/migrate/source/d7/D7Webform.php b/src/Plugin/migrate/source/d7/D7Webform.php
index cf58dba..00ad5c4 100644
--- a/src/Plugin/migrate/source/d7/D7Webform.php
+++ b/src/Plugin/migrate/source/d7/D7Webform.php
@@ -442,7 +442,7 @@ class D7Webform extends DrupalSqlBase implements ImportAwareInterface, RollbackA
$max = $extra['max'];
$step = !empty($extra['step']) ? $extra['step'] : 1;
for ($value = $min; $value <= $max; $value += $step) {
- $new_element[$value] = $value;
+ $new_element['#options'][$value] = $value;
diff --git a/CRM/Stripe/PaymentIntent.php b/CRM/Stripe/PaymentIntent.php
index 87d6189..74ceea4 100644
--- a/CRM/Stripe/PaymentIntent.php
+++ b/CRM/Stripe/PaymentIntent.php
@@ -413,6 +413,12 @@ class CRM_Stripe_PaymentIntent {
$intentParams = [];
$intentParams['confirm'] = TRUE;
+ $intentParams['confirmation_method'] = 'manual';
+ if (empty($params['paymentIntentID']) && empty($params['paymentMethodID'])) {
diff --git a/src/BlazyAlter.php b/src/BlazyAlter.php
index e764945..86c1821 100644
--- a/src/BlazyAlter.php
+++ b/src/BlazyAlter.php
@@ -148,7 +148,7 @@ class BlazyAlter {
*/
public static function ckeditorCssAlter(array &$css, Editor $editor): void {
if (self::isCkeditorApplicable($editor)) {
- $path = Blazy::getPath('module', 'blazy', TRUE);
+ $path = Blazy::getPath('module', 'blazy');
diff --git a/src/Plugin/WebformHandler/CivicrmWebformHandler.php b/src/Plugin/WebformHandler/CivicrmWebformHandler.php
index c410e90..ad56b0c 100644
--- a/src/Plugin/WebformHandler/CivicrmWebformHandler.php
+++ b/src/Plugin/WebformHandler/CivicrmWebformHandler.php
@@ -142,11 +142,11 @@ class CivicrmWebformHandler extends WebformHandlerBase {
/**
* {@inheritdoc}
*/
- public function postSave(WebformSubmissionInterface $webform_submission, $update = TRUE) {
- $this->civicrm->initialize();
@jitendrapurohit
jitendrapurohit / D7WebformCiviCRM.php
Last active December 8, 2021 09:07
Webform CiviCRM migration from D7 to D9
<?php
namespace Drupal\webform_migrate\Plugin\migrate\source\d7;
use Drupal\migrate\Event\ImportAwareInterface;
use Drupal\migrate\Event\RollbackAwareInterface;
use Drupal\migrate\Event\MigrateImportEvent;
use Drupal\migrate\Event\MigrateRollbackEvent;
use Drupal\migrate\Row;
use Drupal\migrate_drupal\Plugin\migrate\source\DrupalSqlBase;
uuid: 8a2e3ab8-d974-41de-a64e-f799a245a6da
langcode: en
status: open
dependencies:
module:
- webform_civicrm
open: null
close: null
weight: 0
uid: 1
diff --git a/src/AdminForm.php b/src/AdminForm.php
index 8988231..e7cbefe 100644
--- a/src/AdminForm.php
+++ b/src/AdminForm.php
@@ -1279,10 +1279,13 @@ class AdminForm implements AdminFormInterface {
'#group' => 'webform_civicrm',
'#title' => t('Additional Options'),
'#attributes' => array('class' => array('civi-icon-prefs')),
- '#description' => '<p>' .
- t('To have this form auto-filled for anonymous users, enable the "Existing Contact" field for :contact and send the following link from CiviMail:', array(':contact' => $utils->wf_crm_contact_label(1, $this->data, TRUE))) .
diff --git a/CRM/Contribute/Form/UpdateSubscription.php b/CRM/Contribute/Form/UpdateSubscription.php
index 0e50b0383c..8f4ef3921f 100644
--- a/CRM/Contribute/Form/UpdateSubscription.php
+++ b/CRM/Contribute/Form/UpdateSubscription.php
@@ -132,6 +132,8 @@ class CRM_Contribute_Form_UpdateSubscription extends CRM_Contribute_Form_Contrib
}
$this->assign('editableScheduleFields', array_diff($this->editableScheduleFields, $alreadyHardCodedFields));
+ $this->assign('frequency_unit', $this->_subscriptionDetails->frequency_unit);
+ $this->assign('frequency_interval', $this->_subscriptionDetails->frequency_interval);