Skip to content

Instantly share code, notes, and snippets.

View lcube45's full-sized avatar
🏌️‍♂️
Focusing

lcube lcube45

🏌️‍♂️
Focusing
View GitHub Profile
@lcube45
lcube45 / MyTextFilter.php
Last active June 1, 2020 14:55
Drupal 8 - créer un filtre de texte personnalisé
<?php
namespace Drupal\my_module\Plugin\Filter;
use Drupal\Component\Utility\Html;
use Drupal\filter\FilterProcessResult;
use Drupal\filter\Plugin\FilterBase;
/**
* Makes the tables in the content show up using Bootstrap styling.
@lcube45
lcube45 / mymodule.php
Created June 1, 2020 14:56
Drupal 8 - hook update - installEntityType/uninstallEntityType
<?php
/**
* Update- Create your_entity_name entity.
*/
function my_module_update_8001() {
//check if the table exists first. If not, then create the entity.
if(!db_table_exists('your_entity_name')) {
\Drupal::entityTypeManager()->clearCachedDefinitions();
\Drupal::entityDefinitionUpdateManager()
@lcube45
lcube45 / mymodule.php
Created June 1, 2020 14:57
Drupal 8 - BaseFieldDefinition - entity_reference_revisions
<?php
// si limitation sur les bundles de paragraphes: renseigner target_bundles
// ajout du widget de paragraphs "classic paragraphs
$fields['paragraphs'] = BaseFieldDefinition::create('entity_reference_revisions')
->setLabel('Paragraphs')
->setDescription('Paragraphs')
->setCardinality(FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED)
->setRequired(TRUE)
@lcube45
lcube45 / gist:9140114156486609dd5ee0118f5e7adb
Last active June 1, 2020 15:03
Drupal 8 - update core 8.8.1->8.8.2
composer update drupal/core --with-dependencies
@lcube45
lcube45 / README.MD
Created June 1, 2020 15:24
Drupal 8 et Composer
@lcube45
lcube45 / gist:958f3326c3f075b7bbc29a9cf7c6904a
Created October 6, 2020 15:20
Update package composer-drupal-optimizations
composer update zaporylie/composer-drupal-optimizations --no-plugins && composer update --lock
@lcube45
lcube45 / gist:ea5b47477e19cd9ddceb2a8f73b07a56
Created January 26, 2021 15:46
Drupal 9 - update drupal core
composer show drupal/core-recommended
composer outdated 'drupal/*'
composer update drupal/core 'drupal/core-*' --with-all-dependencies
@lcube45
lcube45 / gist:c0dbd11eed052377cd188c49945e6901
Last active April 20, 2022 17:04
Drupal 9 composer update
composer update "drupal/core-*" --with-dependencies
sudo lsof -iTCP -sTCP:LISTEN -n -P
// update to composer v2
composer selfupdate --2
// rollback if you want
composer self-update --rollback