Skip to content

Instantly share code, notes, and snippets.

View baikho's full-sized avatar
🇵🇸
Free Palestine

장백호 baikho

🇵🇸
Free Palestine
View GitHub Profile
@baikho
baikho / drupal-field-increase-max-length.php
Last active February 22, 2026 07:55
Drupal update hook to increase max_length on existing Paragraph text fields by updating schema and field storage config
<?php
/**
* Increase max_length for specific paragraph text fields.
*/
function my_module_update_10001() {
$fields = [
'field_caption',
];
@baikho
baikho / drupal-migrate-plus-json-single-item-parser.php
Last active February 22, 2026 07:54
Drupal Migrate Plus JSON Single Item Parser
<?php
namespace Drupal\my_module\Plugin\migrate_plus\data_parser;
use Drupal\migrate\MigrateException;
use Drupal\migrate_plus\Plugin\migrate_plus\data_parser\Json;
/**
* JSON data parser for APIs returning a single object per URL.
*
@baikho
baikho / je-vous-aimerai-toujours.jpg
Last active October 28, 2020 22:02
Seoul 20190419
je-vous-aimerai-toujours.jpg
@baikho
baikho / drupal-8-ajax-add-more-form.php
Last active August 23, 2022 09:34
Drupal 8 Add More Ajax Form
<?php
namespace Drupal\example\Form;
use Drupal\Core\Form\ConfigFormBase;
use Drupal\Core\Form\FormStateInterface;
/**
* Class AjaxAddMoreForm.
*
@baikho
baikho / drupal-5-6-to-8-password-update.php
Last active February 22, 2026 07:57
Drupal 5/6 to Drupal 8 user passwords migration through batch update hook
<?php
use Drupal\user\Entity\User;
/**
* Rehash migrated Drupal 5 MD5 hashes for Drupal 8.
*/
function my_module_update_8101(&$sandbox) {
// This update hook should only be ran if the user migration didn't process