Skip to content

Instantly share code, notes, and snippets.

View junaidpv's full-sized avatar

Junaid P V junaidpv

View GitHub Profile
@junaidpv
junaidpv / 3478258-7.patch
Created February 24, 2025 11:35
Workfaround fix problem reported in https://www.drupal.org/project/domain/issues/3478258 . It is assume to get fixed once https://www.drupal.org/project/domain/issues/2888033 it is closed.
diff --git a/domain_access/src/Plugin/Action/DomainAccessActionBase.php b/domain_access/src/Plugin/Action/DomainAccessActionBase.php
index dfc2b944..b61f5691 100644
--- a/domain_access/src/Plugin/Action/DomainAccessActionBase.php
+++ b/domain_access/src/Plugin/Action/DomainAccessActionBase.php
@@ -72,7 +72,7 @@ abstract class DomainAccessActionBase extends ConfigurableActionBase implements
'#type' => 'checkboxes',
'#title' => t('Domain'),
'#options' => $domains,
- '#default_value' => $this->configuration['id'],
+ '#default_value' => $this->configuration['id'] ?? [],
@junaidpv
junaidpv / preferred_countries-2626982-55-rerolled-for-2.0.2.patch
Created January 1, 2025 16:46
Re-roll of https://www.drupal.org/project/address/issues/2626982#comment-15382818 to apply on 2.0.2 . This would not be required once we started to use 2.1.x releases.
diff --git a/config/schema/address.schema.yml b/config/schema/address.schema.yml
index e706c72..a9643b8 100644
--- a/config/schema/address.schema.yml
+++ b/config/schema/address.schema.yml
@@ -151,6 +151,11 @@ field.widget.settings.address_default:
wrapper_type:
type: string
label: Wrapper type
+ preferred_countries:
+ type: sequence
diff --git a/src/Plugin/views/style/Table.php b/src/Plugin/views/style/Table.php
index 45000a9..e9cc8b1 100644
--- a/src/Plugin/views/style/Table.php
+++ b/src/Plugin/views/style/Table.php
@@ -148,6 +148,21 @@ class Table extends ViewsTable {
],
],
];
+
+ $form['info'][$field]['aggr_strip_tags'] = [
@junaidpv
junaidpv / replace-twitter-logo-with-x.patch
Created December 27, 2024 17:42
Stop using this patch once the issue thread at https://www.drupal.org/project/social_media/issues/3381823 is resolved.
diff --git a/icons/twitter.svg b/icons/twitter.svg
index 293c100..e52bbc8 100644
--- a/icons/twitter.svg
+++ b/icons/twitter.svg
@@ -1,12 +1,30 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<svg width="40px" height="40px" viewBox="0 0 40 40" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
- <!-- Generator: Sketch 48.2 (47327) - http://www.bohemiancoding.com/sketch -->
- <title>Shape</title>
- <desc>Created with Sketch.</desc>
@junaidpv
junaidpv / 2821962-81.patch
Created December 27, 2024 16:44
Patch form of change from MR https://www.drupal.org/project/drupal/issues/2821962#comment-15758857 (comment #81). Also, rerolled to make it apply as we already have patch https://www.drupal.org/project/drupal/issues/2787051#comment-14166134 which preent directly applying of this patch.
diff --git a/core/modules/views/src/Form/ViewsExposedForm.php b/core/modules/views/src/Form/ViewsExposedForm.php
index d68b1dd5363..828ca44ea9c 100644
--- a/core/modules/views/src/Form/ViewsExposedForm.php
+++ b/core/modules/views/src/Form/ViewsExposedForm.php
@@ -10,6 +10,7 @@
use Drupal\Core\Render\Element\Checkboxes;
use Drupal\Core\Url;
use Drupal\views\ExposedFormCache;
+use Drupal\views\Views;
use Symfony\Component\DependencyInjection\ContainerInterface;
diff --git a/src/Plugin/views/style/Table.php b/src/Plugin/views/style/Table.php
index 89f5212..b219f85 100644
--- a/src/Plugin/views/style/Table.php
+++ b/src/Plugin/views/style/Table.php
@@ -121,6 +121,21 @@ class Table extends ViewsTable {
],
],
];
+
+ $form['info'][$field]['aggr_strip_tags'] = [
@junaidpv
junaidpv / webform-table-not-make-table-sticky.patch
Created October 10, 2024 20:23
Make tables non-sticky in the webform module. Keep this patch until https://www.drupal.org/project/drupal/issues/3414067 it is resolved.
diff --git a/modules/webform_access/src/WebformAccessGroupListBuilder.php b/modules/webform_access/src/WebformAccessGroupListBuilder.php
index 7c731d4f1..83e0c3ef2 100644
--- a/modules/webform_access/src/WebformAccessGroupListBuilder.php
+++ b/modules/webform_access/src/WebformAccessGroupListBuilder.php
@@ -64,7 +64,7 @@ class WebformAccessGroupListBuilder extends ConfigEntityListBuilder {
// Table.
$build += parent::render();
- $build['table']['#sticky'] = TRUE;
+ $build['table']['#sticky'] = FALSE;
diff --git a/src/Plugin/Block/MiniLayout.php b/src/Plugin/Block/MiniLayout.php
index 7306a81c2b2ec5e49522661b4edd61ff2bc8d132..50576902abafc5a17a8e5b90ec75248423afdaf4 100644
--- a/src/Plugin/Block/MiniLayout.php
+++ b/src/Plugin/Block/MiniLayout.php
@@ -24,6 +24,11 @@ use Drupal\Core\Plugin\Context\ContextRepositoryInterface;
*/
class MiniLayout extends BlockBase implements ContextAwarePluginInterface, ContainerFactoryPluginInterface {
+ /**
+ * @var Drupal\Core\Entity\EntityTypeManagerInterface;
diff --git a/config/module.config.php b/config/module.config.php
index 88b4c68..37e2414 100644
--- a/config/module.config.php
+++ b/config/module.config.php
@@ -58,9 +58,9 @@ return [
],
],
'controllers' => [
- 'invokables' => [
+ 'factories' => [
@junaidpv
junaidpv / fix-nested-pargraph-parent-type.patch
Created September 2, 2024 12:01
Nested migrated field_collection items are still having field_collection_item as parent type set. Fix it.
diff --git a/src/Plugin/migrate/source/d7/FieldCollectionItem.php b/src/Plugin/migrate/source/d7/FieldCollectionItem.php
index 0dc9460..f34fc2d 100644
--- a/src/Plugin/migrate/source/d7/FieldCollectionItem.php
+++ b/src/Plugin/migrate/source/d7/FieldCollectionItem.php
@@ -71,8 +71,12 @@ class FieldCollectionItem extends FieldableEntity {
])
->range(0, 1);
$parent_row = $query->execute()->fetchObject();
+ $parent_type = $parent_row->entity_type;
+ if ($parent_type == 'field_collection_item') {