See https://www.drupal.org/project/drupal/issues/3089751 & https://www.drupal.org/forum/support/theme-development/2018-12-08/prevent-form-actions-from-appearing-in-a-modal-dialog
In mytheme.libraries.yml
dialog.ajax:
js:
<?php | |
// drush updb ; trigger expection so the update don't pass. | |
// drush cim ; import your new field. | |
// drush updb ; the hook update is successfull and values are copied. | |
/** | |
* Populate formatted texts from previous field on paragraph callout. | |
*/ | |
function mymodule_update_10103(&$sandbox): void { |
<?php | |
$entity_type = 'node'; | |
$group_name = 'the_group_id'; | |
$context = 'form'; | |
$form_displays = \Drupal::entityTypeManager() | |
->getStorage('entity_form_display') | |
->loadByProperties(['targetEntityType' => 'node']); | |
foreach ($form_displays as $display) { |
// Format/fix uncommitted files | |
"scripts": { | |
"codefix": "for F in $(git diff --name-only); do vendor/bin/phpcbf \"$F\"; done", | |
} | |
// ... |
<?php | |
namespace Drupal\mymodule\Form; | |
use Drupal\Core\Form\FormBase; | |
use Drupal\Core\Form\FormStateInterface; | |
/** | |
* Provides a custom form. | |
*/ |
<?php | |
/** | |
* Get the value out of a view Result for a given date field. | |
* | |
* @param \Drupal\views\ResultRow $result | |
* A given view result. | |
* @param \Drupal\views\Plugin\views\field\EntityField $field | |
* A given date field. | |
* |
<?php | |
// Custom view page title | |
// @see https://www.drupal.org/node/2067859#comment-14675179 | |
/** | |
* Implements hook_views_post_render(). | |
*/ | |
function mymodule_views_post_render(Drupal\views\ViewExecutable $view) { | |
if ($view->element['#view_id'] == 'id_of_view') { |
<?php | |
/** | |
* @file | |
* Contains a custom function to get the title from a Url. | |
*/ | |
use Drupal\Core\Url; | |
use Symfony\Component\HttpFoundation\Request; |
/// Make element fully-clickable. | |
/// @author Matthieu Scarset | |
/// @param string $element | |
/// (optional) The button element which should get the click. Default: 'a'. | |
/// @param string $wrapper | |
/// (optional) The element's HTML wrapper(s), useful if convoluted markup. Default: empty string. | |
/// @link https://gist.github.com/MatthieuScarset/397da3b000ce6d9523dd50f525eabaf0 | |
/// | |
/// @example Simple card div with the link directly inside. | |
/// <div class="fullclick"> |
/** | |
* @file | |
* Tooltip plugin. | |
*/ | |
(function (Drupal, CKEDITOR) { | |
CKEDITOR.plugins.add('tooltip', { | |
icons: 'tooltip', | |
init: function (editor) { | |
// Stop now if not allowed to use editor. |