This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/Commands/core/DrupalCommands.php b/src/Commands/core/DrupalCommands.php | |
--- a/src/Commands/core/DrupalCommands.php | |
+++ b/src/Commands/core/DrupalCommands.php | |
@@ -108,6 +108,10 @@ | |
$min_severity = $options['severity']; | |
foreach ($requirements as $key => $info) { | |
$severity = array_key_exists('severity', $info) ? $info['severity'] : -1; | |
+ if (is_object($severity)) { | |
+ // From Drupal 11.2, severity might be an object. | |
+ $severity = $severity->value; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
echo 'Docker Hub rate limits for anonymous users:' | |
TOKEN=$(curl "https://auth.docker.io/token?service=registry.docker.io&scope=repository:ratelimitpreview/test:pull" | jq -r .token) | |
curl --head -H "Authorization: Bearer $TOKEN" https://registry-1.docker.io/v2/ratelimitpreview/test/manifests/latest | |
echo 'Docker Hub rate limits for authenticated users:' | |
TOKEN=$(curl --user 'user:password' "https://auth.docker.io/token?service=registry.docker.io&scope=repository:ratelimitpreview/test:pull" | jq -r .token) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php declare(strict_types=1); | |
/** | |
* @file | |
* Drush script to change the price fields from integer to decimal. | |
*/ | |
use Drupal\Core\Database\Database; | |
// Check whether there are changes to field definitions. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Drupal\media\Entity\Media; | |
// Get the ids of all media entities. | |
$media_ids = \Drupal::entityQuery('media') | |
->accessCheck(FALSE) | |
->execute(); | |
// Load and process each media entity. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Exit the script if any statement returns a non-true return value. | |
set -e | |
# Goto the project root using Drush | |
root="$(drush dd)" | |
cd "$root" | |
cd .. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php declare(strict_types=1); | |
namespace Drupal\my_module; | |
use Drupal\Core\Entity\ContentEntityInterface; | |
use Drupal\Core\Path\CurrentPathStack; | |
use Drupal\Core\Session\AccountProxyInterface; | |
use Drupal\Core\StringTranslation\StringTranslationTrait; | |
use Twig\Extension\AbstractExtension; | |
use Twig\TwigFunction; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php declare(strict_types = 1); | |
namespace Drupal\my_module\Form; | |
use Drupal\Core\Form\ConfigFormBase; | |
use Drupal\Core\Form\FormStateInterface; | |
use Drupal\Core\Form\RedundantEditableConfigNamesTrait; | |
/** | |
* Configure mymodule settings for this site. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Drupal\frs_blocks\Plugin\Context; | |
use Drupal\Core\Cache\CacheableMetadata; | |
use Drupal\Core\Plugin\Context\Context; | |
use Drupal\Core\Plugin\Context\ContextProviderInterface; | |
use Drupal\Core\Plugin\Context\EntityContext; | |
use Drupal\Core\Plugin\Context\EntityContextDefinition; | |
use Drupal\Core\Routing\RouteMatchInterface; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Drupal\frs_entities\Entity\Bundle; | |
use Drupal\Core\Field\FieldItemList; | |
/** | |
* A bundle class for node entities. | |
* | |
* @property FieldItemList $field_content |
NewerOlder