Files
drupal-quartiersdedemain/patches/image_field_caption_storage_columns.patch
bachir f0746c101a maj Drupal 10.5.4 -> 10.6.22 + modules contrib (cibles max D10/PHP8.1, sauts majeurs inclus)
- 154 packages drupal/* mis a jour (scan catalogue p2, filtre core 10.x + PHP 8.1)
- patches: 3 obsoletes retires (image_field_caption rewrite upstream, video_embed_field live, page_manager devel_load), core 2671162 re-rolle en local (prod-only), 2645922 garde
- +2 patches locaux image_field_caption: table optionnelle (updb) + lecture caption depuis le stockage champ
- pin-back drupal/jquery_ui_datepicker:2.1.1 + drupal/jquery_ui_slider:2.1.0 (modules enabled, orphelins apres BEF 7.x) -> pm:uninstall sur prod puis composer remove en commit separe
- sous-module starterkit: contraintes maj + retrait content_lock_timeout (fusionne dans content_lock 3.x, branche gogs q2d-maj-20261122)
- updb OK (23 updates), cex 28 fichiers, tests front 10 pages 200 + baseline avant/apres (ai-docs/front-baseline)

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-11-22 16:25:20 +01:00

52 lines
1.5 KiB
Diff

--- a/src/ImageCaptionItem.php
+++ b/src/ImageCaptionItem.php
@@ -2,7 +2,10 @@
namespace Drupal\image_field_caption;
+use Drupal\Core\Field\FieldStorageDefinitionInterface;
use Drupal\Core\Form\FormStateInterface;
+use Drupal\Core\StringTranslation\TranslatableMarkup;
+use Drupal\Core\TypedData\DataDefinition;
use Drupal\image\Plugin\Field\FieldType\ImageItem;
/**
@@ -24,6 +27,37 @@
}
/**
+ * {@inheritdoc}
+ */
+ public static function schema(FieldStorageDefinitionInterface $field_definition) {
+ $schema = parent::schema($field_definition);
+ $schema['columns']['caption'] = [
+ 'description' => 'The caption text.',
+ 'type' => 'text',
+ 'not null' => FALSE,
+ ];
+ $schema['columns']['caption_format'] = [
+ 'description' => 'The caption format.',
+ 'type' => 'varchar',
+ 'length' => 255,
+ 'not null' => FALSE,
+ ];
+ return $schema;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public static function propertyDefinitions(FieldStorageDefinitionInterface $field_definition) {
+ $properties = parent::propertyDefinitions($field_definition);
+ $properties['caption'] = DataDefinition::create('string')
+ ->setLabel(new TranslatableMarkup('Caption'));
+ $properties['caption_format'] = DataDefinition::create('filter_format')
+ ->setLabel(new TranslatableMarkup('Text format of the caption'));
+ return $properties;
+ }
+
+ /**
* {@inheritdoc}
*/
public function fieldSettingsForm(array $form, FormStateInterface $form_state) {