By admin , 18 October, 2025 Docksal: access to local network (connect to LM Studio) Add to project docksal.yml Tags docker docksal
By admin , 17 October, 2025 Drupal.org Gitlab: pulling in new branches from an issue fork's parent You can then pull the latest branches from the parent origin, and push them to the issue-fork origin. For instance, to add Drupal Core 10.1.x, you could do this: Tags git drupal.org
By admin , 7 October, 2025 Append custom field to views programmatically /** * Implements hook_views_pre_view(). */ function MYMODULE_views_pre_view(ViewExecutable $view) { if ($view->id() === 'VIEWNAME') { $display_handler = $view->getDisplay(); $fields = $display_handler->getOption('fields'); $fields['blacklis Tags views field
By admin , 7 October, 2025 Simple views custom field plugin Add/** * {@inheritdoc} */ public function query() {}if you don't use any queriesUse 'views' table name ($data['views']) Tags views field
By admin , 22 September, 2025 Get client IP address $request_stack = \Drupal::service('request_stack'); $request = $request_stack->getCurrentRequest(); $ip_address = $request->getClientIp(); Tags request
By admin , 22 September, 2025 entityQuery: select entities created N days ago $timestamp = \Drupal::time()->getCurrentTime() - (180 * 24 * 60 * 60); $ids = \Drupal::entityQuery('activities') ->accessCheck(FALSE) ->condition('type', ['node_mention', 'comment_mention', 'comment_reply'], Tags entityQuery
By admin , 22 September, 2025 entityQuery: use several types $query = \Drupal::entityQuery('your_entity_type') ->condition('type', ['node_mention', 'comment_mention', 'comment_reply'], 'IN'); Tags entityQuery
By admin , 22 September, 2025 Rename existing custom module UPDATE config SET name = REPLACE(name, 'custom_complaint', 'custom_feedback') WHERE name LIKE 'custom_complaint%'; UPDATE config Tags module
By admin , 22 September, 2025 Show node revision update date instead of "created' function mytheme_preprocess_node(array &$variables) { $node = $variables['node']; $current_user = \Drupal::currentUser(); $revision_ids = \Drupal::entityTypeManager() ->getStorage('node') ->revisionIds($node); if (count($revision_ids) > 1) { $revision_user = $ Tags revision preprocess