Questions tagged [9]

Version tags should be used only for questions that apply to a version only, not to merely say what version a site is using.

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

Search file attachments module and drupal 9

I have a website that uses the search API module to generate search results for sets of pages and for files - mostly pdfs. To help do this I use the search_file_attachments project. In the process of ...
1
vote
1answer
23 views

drupal-scaffold append robots.txt

We recently upgraded to Drupal 9.3.0 with the composer layout. Each time we execute composer update the contents of robots.txt is overlayed with the file located in core/assets/scaffold/files/robots....
0
votes
1answer
13 views

Get class on item.below (child item of menu) inside <li> tag in menu--main.html.twig

Hi I can't insert class in child item of main menu and remove existing. Part of my code looks like this: {% for item in items %} {% set item_classes = [ 'menu-item-edot', item....
1
vote
0answers
34 views

Programmatically get a full page html rendering of a route/page

We provide our content via APIs. At times we use the Views Restful approach, and at times the JSONAPI. We need to add an API field on nodes that is a full HTML rendering of that node's page according ...
0
votes
1answer
27 views

How can I load a template from a custom module on a certain page?

I have a page at path /user/{id}/module, and I'm trying to have Drupal load a custom template from my module when this page is accessed. The twig debug output shows suggestions for the template name ...
0
votes
0answers
16 views

Redirect existing file url to url

I have existing file with url: https://example.com/sites/default/files/public_files/pages/example%20documents/document.pdf and I want to redirect it to: https://example.com/en/new-url I did not find ...
1
vote
1answer
9 views

Disable certain rows of a Entity Reference Source view

I have a field that is an entity reference on a piece of content. I created a view that is an Entity Reference Source and set the reference type on the field to that view. When editing the content, I ...
1
vote
1answer
36 views

Error: Call to undefined function drush_shift()

We recently moved to Drupal 9.3.0 with a composer file layout and Drush 11.0. We make use of Drush Scripts to execute website functions from Crontab. One specific case is sending a newsletter email ...
1
vote
0answers
19 views

Referencing disabled users during migration

I have migration that creates files. For file owners I'm trying to find existing user by email and if don't find I create one on fly. Problem is that those users I'm creating must be disabled (I don't ...
-1
votes
0answers
19 views

How do I use web-assembly and web-worker? [closed]

I am planning to use hunspell spell checker that is built into a web-assembly .wasm file that is accessed/downloaded via a web-worker though a JavaScript. I want to know, how can I do such a thing on ...
0
votes
0answers
17 views

Functional test for emails (subject and title)

Question: How can a Drupal Functional Test (extenting BrowserTestBase) check for a certain Mail-Subject and Mail-Body defined in hook_mail in a custom module ? Context: I have a custom module which ...
0
votes
1answer
8 views

Autoload helper classes in tests/src/ for phpunit in contrib module

I am working on a contrib module with phpunit tests. Currently there is no composer.json or phpunit.xml or installation routine in the module itself, instead one has to run the functional and browser ...
2
votes
1answer
31 views

How to get the description text from metatag field

A content type in my Drupal 9 instance uses the Metatag module. I want to extract the 'description' metatag value and include it in a twig template (for the node). But when I look at the variables ...
2
votes
1answer
126 views

Why does Programmatic Node Unpublish not Work?

We recently upgraded to Drupal 9.3.0 using a Composer file layout. The resulting website is working correctly and is now running in the publish domain. We have a set of utilities that we run as ...
0
votes
0answers
8 views

Use Node title as default value in alt field of field_image migration

I've been working on a D7 to D9 migrate project, and encountered an issue around field_image's alt value. The D7 site does not have all the field_image alt tag setup, so we'd like to use the imported ...
1
vote
2answers
29 views

How to apply nofollow and target_blank on external links in text created with CKEditor?

When I create a node, I often need to add links to external websites in the text. I want all the external links to open in a new tab and I want them to have a nofollow. The body field uses CKEditor. ...
0
votes
0answers
8 views

Permission for publish field on a translation

the website is a multilingual website, and the Publish field is checked as translateable. user one, can see the Publish checkbox on translation and can change it. but in the other role (let's call it ...
2
votes
2answers
521 views

Why do setter methods in an entity return $this?

Writing a custom entity type I noticed that all setter methods in entity classes are returning $this after changes, as methods modify the object and so object will definitely being modified, then ...
0
votes
0answers
11 views

Front menu not showing subitems

I've generated my menu based on the menu template from the stable theme {% macro menu_links(items, attributes, menu_level) %} {% import _self as menus %} {% if items %} {% if menu_level == 0 %}...
1
vote
1answer
24 views

Migrating Wysiwyg/Ckeditor embedded images to embeded images

I am migrating a Drupal 7 site that is using: drupal/wysiwyg:^2.9' (plus the ckeditor library) drupal/media:^2.27' drupal/media_ckeditor:^2.14' In Drupal 7, when you insert an image into the wysiwyg ...
0
votes
0answers
5 views

ElasticSearch Views integration not working with multiple words

In Drupal 9 I have setup ElasticSearch 7. I have added a Search API View in which I have added field to search through the "rendered HTML" field. This seems all pretty basic if you ask me, ...
0
votes
1answer
26 views

Create node by post Api call fail with message "Could not determine entity type bundle: \\u0022type\\u0022 field is missing."}

I'm trying to create a node via Drupal API but I get this error: Got error 'PHP message: PHP Fatal error: Uncaught GuzzleHttp\\Exception\\ClientException: Client error: `POST https://site.it/entity/...
0
votes
1answer
35 views

Customer profiles cannot hold more than 1 values, even when allowing multiple profiles per user

I have custom API that creates new Customer profiles with different addresses / emails: $profileStorage->create([ 'type' => 'customer', 'uid' => $this->currentUser->id(),...
0
votes
0answers
17 views

Can't find "starts with" for Filter criteria In Views (indexed field for taxonomy)

I created a view using indexed fields (search api) to list a taxonomy. I used the rest export checkbox so I have an api endpoint for my view. I am not able to find a filter criteria "starts with&...
0
votes
0answers
12 views

How can I set the purchased entity for an order item?

We have migrated products and orders from a Drupal 6 site to Drupal 9 site. We had a product type dues for which we already had products in the existing Drupal 9 system. So we skipped the migration of ...
0
votes
0answers
50 views

Cannot Login, error msg shows "To log in to this site, your browser must accept cookies from the domain"

On my dev environment hosted on the cloud which has SSL, I added this to the settings.php $secure = true; // if you only want to receive the cookie over HTTPS $httponly = true; // prevent JavaScript ...
0
votes
0answers
34 views

CKEditor hides from my testing tool

I am building an automated testing tool for the drupal site that I maintain. The site has migrated to D9 and functions normally for a human user. When my python scripts pull up selenium/Chrome ...
0
votes
0answers
12 views

How to duplicate a view as a page for another view

I have 5 views in the back office, each view contains in the display a single page with different fields and filter criteria and other configuration, I would like to gather all the 5 views/pages as 5 ...
0
votes
1answer
18 views

views_embed_view() ignores template file using Ajax

I have a view shown in two ways. Once I show it as a normal block and one time using views_embed_view() in combination with Ajax. For the regular block I created a views-view-list.html.twig template ...
0
votes
1answer
45 views

Is there a way to control how RouteProvider caches a route?

Drupal caches routes in cache_data. This happens in Drupal\Core\Routing\RouteProvider. I am looking at a high traffic website with "interactive" search functionality based on a map. When you ...
1
vote
0answers
21 views

How to hide a facet item if it does not narrow the results?

I have a facet of taxonomy terms with the links widget. There are 3 taxonomy terms displaying with the number of results in the bracket. Term 1 (3) Term 2 (2) Term 3 (10) When I select Term 1, the ...
0
votes
1answer
21 views

How can I print a single field?

I've got a taxonomy page (https://www.dovericaricare.it/becharge) that I'm trying to customize using a twig template. I don't understand what syntax I should use to print fields like the logo ({{ ...
0
votes
0answers
18 views

Views filtering by two values from same field and comparing with another time field

I have a customer which works with buses and passenger transportation.Now he would like that all routes would be visible on a site and guests could filter routes by source and destination points. ...
0
votes
0answers
23 views

Inline commenting like google Doc or confluence [closed]

I haven't found any module for inline commenting on Drupal 8 and 9. what I'm looking for is something like Google Doc or Confluence commenting. how we can implement such functionality with Drupal ...
-2
votes
0answers
27 views

Condition in views

My task is to make a drupal 9 website for accounting books in the library of an educational institution. I have created three types of materials: book card (book) reader issue. When issuing a book ...
1
vote
0answers
49 views

What is the POST end point for taxonomy?

I have a test script to create (POST) a term for a Tags vocabulary using cUrl. That simple script is working fine on Drupal 8.9.20, but it returns a 404 error on Drupal 9.3.0. {"message":&...
0
votes
1answer
31 views

How to get current region or current block of node in hook_theme_suggestions_node()

I need to get the current region or the current block where a node is rendered, in hook_theme_suggestions_node(). function mymodule_theme_suggestions_node(array $variables) { $node_region = "I ...
2
votes
1answer
129 views

Unique constraint on several entity fields fails when >1 jsonapi POST requests happen right after another

In a fully decoupled drupal 9 project I have a custom entity type and added a unique constraint for several fields just as described here. This works well and adding a second entity with the same ...
0
votes
0answers
27 views

Apply image style on asset image

I have a static image in my theme folder. Is it possible to apply an image_style to it ? When I apply the image_style, I have this url that's generated : /sites/default/files/styles/card_product/...
0
votes
1answer
111 views

Tarball 9.3.0 to Composer 9.3.0

We have a large production website running 8.9.20 with a Tarball directory format. We would like to make the jump to 9.3.0 and convert the site from Tarball to Composer directory format. I performed ...
1
vote
1answer
48 views

How do I share Google photos? [closed]

I would like to have all shared albums of a certain google account automatically into a Drupal website. I was able to establish a connection with 'Google_photos_api' and show all shared albums on site ...
-1
votes
1answer
25 views

Set the quantity per product equal to value in input

I'm using the Commerce Ajax Add to Cart module to add a product to my cart using AJAX. I guess I'll have to do that by creating a patch. It's working fine, but I'd like to change how a product is ...
1
vote
1answer
93 views

How do I switch from a recommended release to a development snapshot?

Is there a non-Drush, Ludwig way to switch from the recommended release of a module to a development snapshot in Drupal 9, for example copying the development snapshot files and run update.php? The ...
1
vote
0answers
24 views

How to reload flagging form via ajax?

My task is to ajaxify complex flag form (with additional fields). I need this because the default ajax flag does not dupport fiedls. I need to have the flagging form for create flag and then update it ...
3
votes
1answer
134 views

Custom 404 handling for images

I'm looking for a way to handle 404's on images in Drupal. I have created several subscribers, but none seem to get triggered. My first try was to create subscriber that extends RouteSubscriberBase. ...
1
vote
0answers
23 views

How to control display of state_province field from the address module

Ok - the title is not terribly clear. I'm building a form that uses Advanced Address. That element comes from the Address module. I want to control the display, or perhaps a better way of saying it; I ...
1
vote
0answers
34 views

Custom REST resource throws 404

I have created a custom REST resource to create a specific node entry. (I need some additional checks, so I can't use the available node resource.) The endpoint has been enabled in the UI. However, ...
0
votes
1answer
42 views

How do I use {{file_url()}} to get image field URLs in views-view-fields.html.twig?

I tried to use the following code in views-view-fields. {{ file_url(fields.field_featured_image.content.0['#item'].entity.uri.value) }} When I use that code, I get this error. TypeError: Argument 1 ...
1
vote
1answer
41 views

Entity autocomplete form API field with ViewsSelection handler

I'm trying to get an implementation of the Entity Autocomplete Form API field with a view selection handler working in Drupal 9. I have seen some examples in New 'entity_autocomplete' form element ...
1
vote
1answer
54 views

Theming a EntityListBuilder.php table using drupal/examples/content_entity_example as base

Any idea how I could to use my own custom module twig file to theme my table? I'm using drupal/examples -> content_entity_example as a starting point: in content_entity_example.module implementing ...

1
2 3 4 5
16