All Questions

Filter by
Sorted by
Tagged with
0 votes
0 answers
4 views

Sort by date after date_modify

Using Views > fields I want to sort 'date_modify' result. The statement(code) below provides all the dates (unsorted), nicely, however Views > Sort Criteria doesn't work since it seems to only ...
Systemlord's user avatar
-2 votes
0 answers
12 views

contextual menu module - error 400 on URL /contextual/render break contextual links on a limited number of pages

on a fully developed drupal, some contributors noticed me that the contextual menu links are broken on a limited set on pages. After a quick check i see that all those pages have a broken XHR request ...
SupFrig's user avatar
  • 109
0 votes
1 answer
16 views

How to inject RevisionableStorageInterface()?

I have a module I'm trying to update to Drupal 11. Here's the code: public function processItem($data) { $entity_type = $this->entityTypeManager->getDefinition($data['entity_type']); $...
Patrick Kenny's user avatar
0 votes
0 answers
10 views

How to add a filter form in a view to filter entries based on selected entries from a related content type?

I have created several filter forms for content types to filter content based on its taxonomies. In the View Filter Criteria section I can choose a custom field from the content type which relates to ...
Laurence Cope's user avatar
0 votes
0 answers
12 views

in view path, can I replace tid with token:name

What I have, the view path bild the path with token id's. such like: excample.com/view?token=555 maybe with [node:field_token:entity:name] or {{ node:field_token:entity:name }} ? with ...
Hartmut Theis's user avatar
0 votes
0 answers
9 views

Can I set a default image for an image field in a webforms form?

Is there a way to set a default image file to an webforms image file field type so that the image shows up instead of a link to it for authenticated users? I know there is a way to have the image show ...
Guybrush Threepwood's user avatar
0 votes
0 answers
17 views

How to create a view with filters using data from an api?

We have a multisite setup and need to share taxonomy data from one site to all of the other sites. I have created a REST Export view on the site that has the taxonomy data. The next thing I've done is ...
Jordan's user avatar
  • 49
-2 votes
0 answers
14 views

get the facet taxonomy label from the query using JS

i have set a facet using a taxonomy ref field from an indexed search api view. Using JS: const searchParams = new URLSearchParams(window.location.search); const facetSearch = searchParams.get('f[0]'); ...
Matoeil's user avatar
  • 3,423
-1 votes
0 answers
17 views

sort by relevance in search api index views

When adding an exposed sort by relevance in a search api view index : The select option has only the option "sort by relevance". What is the use of that exposed sort then ? Should there not ...
Matoeil's user avatar
  • 3,423
1 vote
0 answers
21 views

How add a "Raw value" field on views?

I'm on Drupal 10.2.x and editing the view content. I'm using the contrib module views_cm_current_state. The module implements hook_views_data() to add, for what I understand, a new field. The field ...
Giuseppe's user avatar
  • 971
0 votes
1 answer
14 views

Get Feeds to overwrite edited entity item

I have a custom entity type and use Feeds to populate the entities. All works great on initial import. I then run a cron job that updates some fields of the entity that are not imported from the feed ...
Kevin Finkenbinder's user avatar
-3 votes
0 answers
18 views

Different content display options for mobile and desktop

I have a page with a file field (pdf only). In content display editor I can select the style for my file field. I want to select PDF Viewer (a module) as display style for desktop and PDF Preview (...
Simon Van den Bossche's user avatar
0 votes
2 answers
81 views

Why isn't my eventsubscriber firing when a user logs out?

I working on the advanced_pwa module. My use case is that I want to tell the client side service worker to flush it's cache when a user logs out. I concluded that creating a event subscriber would be ...
gMaximus's user avatar
0 votes
2 answers
25 views

Cannot find file input

Im new here and currently building my first Drupal website. Im having trouble creating a webform because i cant find the file input option to include in the form. When i googled it, i found that the ...
drupalnewbie99's user avatar
1 vote
1 answer
40 views

Two-way Entity reference, programmatically

I'm building a custom module to handle two custom entities which extend ContentEntityBase: Organization and Contact. Organization can have multiple contacts, while contact can belong to one ...
bdereta's user avatar
  • 151
0 votes
1 answer
12 views

Title field does not show for product

Long time user of Commerce here -- but working with a brand-new Drupal 10 install and just realizing how much I was building on prior work with my old setup. Just created a new Product type, ...
Tiffani Chin's user avatar
0 votes
1 answer
47 views

How to get a deep clone of an entity object

Is there a way of getting a second object for an entity that is a different PHP object (with different PHP objects inside as well)? I tried using https://github.com/myclabs/DeepCopy with a node entity ...
joachim's user avatar
  • 846
0 votes
0 answers
47 views

How add a cache context in a form_alter?

I'm on Drupal 10.2.x. I'm writing a form_alter for a node add/edit form, where I am putting some extra markup data depending on terms of a vocabulary licenses. function my_module_form_alter(&$form,...
Giuseppe's user avatar
  • 971
-2 votes
1 answer
29 views

Unable to execute drush command in local [closed]

While running drush, Receiving error stating: [preflight] Package "drupal/core" is not installed I have updated my environment variables like below after installing drush globally. Drush ...
sudhan's user avatar
  • 1
0 votes
0 answers
10 views

Tax, coupon, and zero payment

I am trying to do a very basic task which I guess should be available out of the box. I have read many other comments that do one and not the other, some are even offering programming with hook ...
user3532287's user avatar
1 vote
0 answers
40 views

How to create third party settings for themes?

How to I properly implement third party settings for a theme, without clearing 3rd party settings from other modules? E.g. my site has a gin.settings.yml with third_party_settings: shortcut: ...
Hudri's user avatar
  • 5,530
0 votes
1 answer
49 views

How to render a link to a page fragment in Twig

I have a Twig template that prints a link with the following code: {{ link(item.title, item.url) }} This code is rendered as an a element with a href attribute similar with the following: https://www....
quilx's user avatar
  • 19
0 votes
1 answer
66 views

How can I alter the element markup in a multi-step form?

I have built a multistep webform using webform version 6.2.2 and Drupal 10 and I want to show a summary element on each step that updates with the information of user input from all previous pages. ...
Jamesbeat's user avatar
0 votes
1 answer
95 views

Is there a way to remove cache tags from a render array

When I turn on cache debugging, I see a lot of cache tags for render arrays that don’t make sense. I don’t see an obvious way to remove these cache tags. For example, they don’t seem to appear in the $...
miwayha's user avatar
  • 31
0 votes
0 answers
33 views

What are all the steps needed to migrate from Video Embed WYSIWYG to Core Media (images/video fields too)?

As the title suggests, I'm in the process of upgrading from Drupal 9 to 10 and would like to finally migrate over to Core Media, as opposed to just using inline video/images/files as we have for the ...
ACanadianCoder's user avatar
0 votes
1 answer
53 views

Access field formatter settings in a field type plugin

How can I get the field formatter settings inside a field plugin? The field plugin extends FieldItemBase and the corresponding field formatter plugin extends FormatterBase. If there is no direct way, ...
Mike's user avatar
  • 1
0 votes
0 answers
20 views

Get display mode of product or product variation where an 'add to cart form' is used in hook_form_alter for the add_to_card_form

I'm using Drupal 10 and the commerce module. I'm using a product display mode 'card' that uses the variations 'add to cart form' format. In hook_form_alter I am hiding the quantity field: function ...
Mike's user avatar
  • 1
0 votes
1 answer
26 views

Erroneous .tar.gz created by drush archive:dump. The archive cannot be restored with drush archive:restore

I use Debian 11, PHP 8.1.28, drupal/core-recommended:10.2.6 and drush/drush:12.5.2. When I run drush archive:dump no error is reported. But when I want to restore the archive with drush archive:...
quilx's user avatar
  • 19
2 votes
2 answers
165 views

How do I enable a PHP extension on GitLab CI?

I'm trying to use Drupal.org's GitLab CI to test a module that has a dependency on a package that requires PHP's ext-sodium to be installed: No composer.lock file present. Updating dependencies to ...
Patrick Kenny's user avatar
0 votes
2 answers
59 views

Can you set default configuration settings for a contrib on install?

I am looking to set default configuration settings for a contributed module, Nodeaccess, on install. I know that you can do that on site spin-up but this module will not be enabled by default. I tried ...
Chad's user avatar
  • 1
-3 votes
2 answers
41 views

Can't seem to find a way to have & in a term description show up as &

In a site on D9. I have a vocabulary that has titles as the term descriptions. One of the term descriptions is This & That No matter what I try, the & is converted to & in CKeditor4. This ...
JAyenGreen's user avatar
0 votes
0 answers
14 views

Drupal multistage webform ECK entity reference token

I have a multi-stage webform where a user will select courses they wish to enrol a user too and on the last page it will confirm the products. This is being done as a checkbox populated by an entity ...
Alex Noble's user avatar
0 votes
1 answer
23 views

Getting menu linkset items

I am using Drupal 10.2.6 and I am trying to get menu items via /jsonapi/system/menu/main/linkset, /jsonapi/system/menu/menu/main/linkset, and /jsonapi/menu/main/linkset, but I always get a 404 error. ...
D3rick's user avatar
  • 3
0 votes
0 answers
46 views

Free/loose mode content translation with paragraphs

The content_translation module available since Drupal 8 allows me to translate content pages (entities/nodes) in a very strict mode: Each paragraph on the source language page has a translated ...
cweiske's user avatar
  • 154
-2 votes
0 answers
26 views

Appointment scheduler with webform with setting to select/enter email

Following the scenario for appointment tool In first step there is a calendar where user select the date. In second step user selects the time for the date selected. Remaining steps are contact form ...
Sharique's user avatar
  • 207
0 votes
0 answers
20 views

How to get cloudflare streaming video URL?

I have install and configured https://www.drupal.org/project/cloudflare_stream module in Drupal 10. I have used "Field type" as "Cloudflare Video" for upload file field. I haven't ...
Ramalingam Perumal's user avatar
-2 votes
0 answers
25 views

Undefined array key 1 in Drupal\quiz\Controller\QuizQuestionController

Hello and thank you for helping me! I'm new to Drupal, working on someone else's site. Background: The site was successfully migrated from Drupal 7 to 9.5.9. Quiz 6.0.0-alpha7 is installed. ...
Angel Leigh McCoy's user avatar
-1 votes
1 answer
36 views

I can't set a page as unpublished

I already have page in drupal have status published and when I change status to draft still page not change status to draft it's seen published How can I solve this problem?
Ahmed Essam's user avatar
0 votes
0 answers
13 views

How to keep preview page active but not displayed in the progress line

In my form settings (/admin/structure/webform/manage/testing/settings/form) I have: Form preview settings > Enable preview page > Optional to be able to display the preview page, which I can ...
Andrés Chandía's user avatar
0 votes
1 answer
31 views

How to automatically create account after an order have been placed

I am looking to set up an e-commerce site on Drupal 10 (Commerce 2). Here is the goal: A user should not be able to create an account without having placed an order. Therefore, on the account settings ...
Alexdezark's user avatar
0 votes
1 answer
25 views

Passing data to a field formatter via views with referenced fields?

In creating a 'traffic light' field formatter, how to access views data stored in an entity 2 levels up? The traffic light is 'green' if speed is 'good'. There is a radar entity which has the location ...
Interlated's user avatar
  • 1,423
1 vote
1 answer
69 views

How do I specify php.ini settings (or a complete file) for Drush?

Before continuing, let me explain that I've tried the methods I've been able to find in documentation. Drush 12.5.2.0 is installed in the project by composer. I've tried adding export DRUSH_INI='/...
WRD's user avatar
  • 319
0 votes
0 answers
33 views

CKEditor5 pages not saving when attempting to use a relative link to file in body

I'm not sure where to look to troubleshoot this - any advice appreciated. Drupal 10 w/CKEditor5 as the text editor for the body field on basic pages. Absolute links linked within the body field save ...
NewtoThis's user avatar
0 votes
0 answers
39 views

File upload becomes empty after form submit for anonymous users

I've build a form in Drupal 9 with Form API. When logged in as admin, all is working fine. Selecting a file as anonymous works, and the validations are checked. But when I submit the form, the ...
user3086053's user avatar
0 votes
0 answers
7 views

Correct price not reflected based on product variation when markeplace page loaded

I am stucked with this issue that correct price is not loaded based on product variation setup in drupal 9.5. Here is my product variation. And here is my marketplace product price and variation ...
Lal Kumar Rai's user avatar
0 votes
0 answers
19 views

JavaScript ES6 modules import from CDN library

I have a custom JavaScript file in my theme which handles some logic for external iframe (not exactly iframe tag but a custom element) loading. Normally, I would declare the CDN or JS file in theme....
Imran Aslam's user avatar
1 vote
2 answers
95 views

PHP constructor property promotion: how to call the parent constructor?

So I have a Controller that I am trying to rewrite to use PHP constructor property promotion: class MyUserController extends UserController { /** * Constructs MyUserController. * * @param \...
Patrick Kenny's user avatar
0 votes
0 answers
15 views

How to automatically add a class to paragraph elements in ckeditor5?

When a paragraph is added to the wysiwyg, I want ckeditor to automatically add a class to it (dynamically in the wysiwyg), such that if I click "source" after the wysiwyg adds a new ...
John's user avatar
  • 293
0 votes
0 answers
19 views

How to add taxonomy and menu to content Mirgation using migrate, migrate_tools, migrate_plus and migrate_source_html?

I am new to Drupal and Would really appreciate the help I am importing html pages using migrate, migrate_tools, migrate_plus and migrate_source_html it is working but I would like to also populate the ...
user avatar
3 votes
1 answer
71 views

How can I add a template suggestion for a field formatter based on the current view mode?

In my Drupal 10 theme how I can get Entity View Mode? I use this to rewrite suggestions /** * Implements hook_theme_suggestions_HOOK_alter(). */ function ...
Aleksandr's user avatar

15 30 50 per page
1
2 3 4 5
1756