πŸ‡ΊπŸ‡¦Ukraine @dunot

Account created on 19 February 2018, almost 7 years ago
#

Recent comments

πŸ‡ΊπŸ‡¦Ukraine dunot
function mymodule_token_info() {
     $eck_type['element'] = [
        'name' => t("eck"),
        'description' => t("Tokens related to eck"),
        'needs-data' => 'machine_name_of_your_eck',
    ];
    ..
    $eck['id'] = [ // add this token ΠΏ.Ρ‡. ΠΏΡ€ΠΎΠΏΠ°Π΄Π°Π΅Ρ‚
       'name' => t("eck id"),
       'description' => t("Id of eck"),
    ];

     return [
       'types' => [
         ..
          'element' => $eck_type
      ],
      'tokens' => [
         ..
         'element' => $eck
      ],
  ];
}
function .._tokens($type, $tokens, array $data, array $options, BubbleableMetadata $bubbleable_metadata) {
  $replacements = [];
  if ($type == 'machine_name_of_your_eck' && !empty($data['machine_name_of_your_eck'])) {
    $eck = $data['element'];
    $eck_id = $eck->id();
     foreach ($tokens as $name => $original) {
      switch ($name) {
        case 'id':
            $replacements[$original] = $eck_id;
          break;
          ..
      }
    }
    return $replacements;
}
πŸ‡ΊπŸ‡¦Ukraine dunot

It seems this works only if csv has "nid" field/column.

πŸ‡ΊπŸ‡¦Ukraine dunot
$mail_handler = \Drupal::service('commerce.mail_handler');
$mail_handler->sendMail($to, $subject, $body, $params);
πŸ‡ΊπŸ‡¦Ukraine dunot

8.x-1.5+1-dev on 2023-04-04 fixes the issue

πŸ‡ΊπŸ‡¦Ukraine dunot

What is it 'id replacement'?

πŸ‡ΊπŸ‡¦Ukraine dunot

Thanks, dshields.
Be carefull with #14 in case of CKEditor`embedded video: the patch doesn't support this case
and causes
ArgumentCountError: Too few arguments to function Drupal\video_embed_field\ProviderPluginBase::renderThumbnail(), 2 passed
to prevent this add

+   $attributes = [];
-   $thumbnail = $provider->renderThumbnail($embed_data['settings']['image_style'], '');
+   $thumbnail = $provider->renderThumbnail($embed_data['settings']['image_style'], '', $attributes);

to modules/video_embed_wysiwyg/src/Plugin/Filter/VideoEmbedWysiwyg.php

Production build 0.71.5 2024