Skip to content

Instantly share code, notes, and snippets.

View podarok's full-sized avatar
🏠
Working from home

Andrii Podanenko podarok

🏠
Working from home
View GitHub Profile
@podarok
podarok / composer.json
Created July 6, 2023 09:54
template for y_lb 2.2.0
{
"name": "drupal/$projectname",
"description": "TODO.",
"type": "drupal-module",
"require": {
"ycloudyusa/y_lb": "^2.2.0",
"php": ">=8.1"
},
"license": "GPL-2.0+",
"minimum-stability": "dev"
@podarok
podarok / 2160091-6e84b57.diff
Created July 14, 2021 13:42
2160091-6e84b57.diff
diff --git a/core/includes/common.inc b/core/includes/common.inc
index 42d9b80d28..f640a90121 100644
--- a/core/includes/common.inc
+++ b/core/includes/common.inc
@@ -12,6 +12,7 @@
use Drupal\Component\Utility\Html;
use Drupal\Component\Utility\SortArray;
use Drupal\Core\Cache\Cache;
+use Drupal\Core\DrupalKernel;
use Drupal\Core\StringTranslation\TranslatableMarkup;
@podarok
podarok / move_extension_list_reset.diff
Last active July 14, 2021 13:53
move_extension_list_reset.diff
diff --git a/core/includes/common.inc b/core/includes/common.inc
index f640a90121..a1397dd9c3 100644
--- a/core/includes/common.inc
+++ b/core/includes/common.inc
@@ -553,15 +553,15 @@ function drupal_flush_all_caches($kernel = NULL) {
// to reset the theme manager.
\Drupal::theme()->resetActiveTheme();
+ // Rebuild module data that is stored in state.
+ \Drupal::service('extension.list.module')->reset();
diff --git a/core/includes/common.inc b/core/includes/common.inc
index f640a90121..42d9b80d28 100644
--- a/core/includes/common.inc
+++ b/core/includes/common.inc
@@ -12,7 +12,6 @@
use Drupal\Component\Utility\Html;
use Drupal\Component\Utility\SortArray;
use Drupal\Core\Cache\Cache;
-use Drupal\Core\DrupalKernel;
use Drupal\Core\StringTranslation\TranslatableMarkup;
@podarok
podarok / core_check_service_language.diff
Created July 7, 2021 12:35
core_check_service_language.diff
diff --git a/core/modules/language/language.module b/core/modules/language/language.module
index 91641dec..cac5f59a 100644
--- a/core/modules/language/language.module
+++ b/core/modules/language/language.module
@@ -294,11 +294,13 @@ function language_modules_installed($modules) {
// Since newly (un)installed modules may change the default settings for
// non-locked language types (e.g. content language), we need to resave the
// language type configuration.
- /** @var \Drupal\language\LanguageNegotiatorInterface $negotiator */
- $negotiator = \Drupal::service('language_negotiator');
@podarok
podarok / features_hook.diff
Last active July 7, 2021 12:13
features_hook.diff
diff --git a/features.module b/features.module
index 07e2740..7d061b2 100644
--- a/features.module
+++ b/features.module
@@ -48,10 +48,12 @@ function features_file_download($uri) {
/**
* Implements hook_modules_installed().
*/
-function features_modules_installed($modules) {
- if (!in_array('features', $modules)) {
@podarok
podarok / launch.json
Created December 24, 2020 08:10
Open Y Visual Studio Code xdebug configuration. When using Vagrant based VM
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Listen for XDebug",
"type": "php",
"request": "launch",
@podarok
podarok / path.diff
Created August 3, 2020 16:30
Libraries OpenY Drupal 9 fix
diff --git a/libraries.module b/libraries.module
index 2ce2f19..e7fe5be 100644
--- a/libraries.module
+++ b/libraries.module
@@ -117,7 +117,7 @@ function libraries_get_libraries() {
// profile, installation profiles may want to place libraries into a
// 'libraries' directory.
if ($profile = \Drupal::installProfile()) {
- $profile_path = \Drupal\Core\Extension\ExtensionList::getPath('profile', $profile);
+ $profile_path = drupal_get_path('profile', $profile);
@podarok
podarok / 1_phpunit-api.md
Created January 4, 2017 16:53 — forked from loonies/1_phpunit-api.md
PHPUnit Cheat Sheet

PHPUnit API reference

  • version 3.6

TODO

Check those constraints:

$this->anything()