Questions tagged [8]

Version tags should be used 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
1 answer
48 views

Content type field to include both media entities and links

I'm new to Drupal and I'm creating a new content type. I know there's two separate fields for media and links, but is there a field that include both? For example, the field is called "News ...
2 votes
0 answers
70 views

What methods are available to resolve "The node.field_name field needs to be updated."?

When Drupal status report says field “field_name” needs to be updated I found out that it sometime hard to resolve. In the past we used to have entup but that was removed. The following works in many ...
  • 2,319
2 votes
1 answer
156 views

get the file URI of an ImageItem

How can I get the file URI of a Drupal\image\Plugin\Field\FieldType\ImageItem instance? I get the field value with $node_entity->get('field_image')[0] but I don't know how to get the file URI.
  • 143
2 votes
0 answers
40 views

How to add views aware configuration options to a field formatter?

There is a contrib field formatter module (bg_img_formatter) which has numerous field configuration options. One of these options is a text field which needs to allow for the same views field ...
  • 927
0 votes
1 answer
36 views

Getting issue on views import?

Accidentally I have deleted the views relationship field. After that I am getting error when try to open views configuration page. To fix the issue I have exported that view from site configuration ...
  • 157
1 vote
1 answer
373 views

How to get a rendered views field value programmatically?

Yes, I see there are many answers already posted here and elsewhere for this; but sadly they are all wrong. These answers include any of the following: $view->style_plugin->getFieldValue($rid, '...
  • 927
0 votes
0 answers
30 views

Ho can I add a class to a specific row in views-view-field template?

I have created a custom views-view-field template and added some custom html and views field similar to this <div class="{{ fields.my_text_field.content }}"> {{ fields.my_media_field....
  • 153
0 votes
1 answer
53 views

After rendering entity form how can be modified?

I rendering a custom entity form display with the following code: $form = $this->entityFormBuilder->getForm($entity, 'array_delimiter'); This is perfect, as it shows what I set on the form ...
0 votes
0 answers
33 views

How to Manage Webhook Notifications?

I had developed a controller to retrieve data from an API via a webhook. This is the type of data I received with https://webhook.site for testing : { "owner": { "id": "...
0 votes
0 answers
21 views

How can I load a translated version of my custom config? [duplicate]

I created a custom configuration form that can be translated into all available languages. My question is how we can get the translated version of the configuration for a specific language on the ...
-1 votes
1 answer
51 views

How to enqueue CSS to administrator side via module

I have a custom Drupal module and I would like to enqueue its CSS to the administrator side. I've tried to add it to the .info.yml file. css: theme: admin-styles.css: {} I also implemented ...
  • 21
0 votes
1 answer
55 views

Unable to programmatically render webform with CAPTCHA

Our website has a custom route, with a controller rendering a custom Webform. This is required, as the form has some hidden fields to be pre-populated. Now I would like to add the CAPTCHA module to ...
  • 164
2 votes
3 answers
453 views

AccessDeniedHttpException on a route with _access: TRUE

In my custom module I have a few "publication" routes that do not need any kind of authentication. Months ago I learnt that I could achieve this with the following requirements in routing....
0 votes
0 answers
98 views

EntitySubqueue save() only working with die() following it

I am trying to add an item to a sub-queue automatically on save. And for some reason, it only works if I include die() afterwards. This adds the new node to the queue function ...
0 votes
1 answer
434 views

EntityQuery condition only if field exists

How to apply a condition only if a field exists? $query = \Drupal::entityQuery('node') ->condition('type', 'videos') ->condition('field_tags', 39, '=') ->condition('status', 1) ->...
0 votes
1 answer
60 views

Creating file from s3fs (S3 bucket) breaks migration

I have s3fs module installed and configured, so when I upload some file it goes to S3 bucket. Then I'm making processing plugin which should copy file from another S3 bucket to Drupal's bucket and ...
  • 405
0 votes
0 answers
55 views

Split a hierarchal taxonomy into multiple facet filters

I'm currently working with an E-Commerce site in Drupal 8 that contains multiple products and multiple specifications set up in a hierarchical taxonomy term called Specifications like this example: ...
  • 13
1 vote
1 answer
137 views

Add Composer to an existing site

I built a Drupal 8.9 site with Composer on a DEV server and copied the files (& db) over to the LIVE server. The LIVE server did not have Composer installed previously so I installed it, locally. ...
  • 82
0 votes
1 answer
56 views

Is it possible to render a View based on the Content language?

Drupal supports the concept of Interface Language and Content Language. I (and every client I have ever asked) seem to have a different opinion of what is "content" and what is "...
  • 927
0 votes
1 answer
39 views

Copied Drupal 8 to Live server now can't log in

I built a simple Drupal 8 website on my DEV box and moved it to the LIVE server. Copied the files on the DEV server into a tarball Moved these file to the LIVE server (using scp). Uncompressed web ...
  • 82
0 votes
1 answer
34 views

Create address element for webform to output country code

I'd like to create a field using webform that accepts a country but outputs the country code. I'm guessing one path forward is to find the handler used by contrib and extend it? Or is that ...
  • 934
-2 votes
1 answer
376 views

Missing or invalid themes

I created 2 custom themes a while ago and I deleted them since I don't need them anymore. Although I deleted all the files, I am still getting this error. Missing or invalid themes The following ...
0 votes
0 answers
36 views

Filtering the result set of entity_autocomplete

The following snippet of code is found in the 'nodeaccess' module. At the moment, the autocomplete is allowing you to search for any user in the db. What I would like to do is only return users that ...
0 votes
1 answer
73 views

Webform block shows for anonymous user but not authenticated

I am using the webforms module (6.1.1) on a Drupal 8 site for a form that shows up in a block on my front page. If I am not logged in (go Incognito or InPrivate mode) the form displays and works. If I ...
  • 82
1 vote
1 answer
217 views

Get raw SQL query from Drupal::entityTypeManager

How can I fetch the raw sql version of the following statement? $t = \Drupal::entityTypeManager() ->getStorage('taxonomy_term') ->loadByProperties(['name'...
  • 595
0 votes
0 answers
223 views

Getting validation error webp image upload

I have added a image field to my "Blog" content type. In image field settings 'Allowed file extensions' section include webp format. When I upload webp format image gerring below validation ...
  • 157
1 vote
0 answers
234 views

Delete millions of unused Paragraphs and their data?

We have a site that after a few years has built up 10 million records in the paragraphs_item table. This is a result of lots of data migrations (where paragraphs are involved) and there are many ...
  • 26.9k
-2 votes
1 answer
39 views

Read view field value in VBO action [closed]

I have a view grid that has custom actions to perform based on selected grid row. To read the view fields from the grid dpm-ed the below command: dpm($this->view->result); The above command ...
  • 33
1 vote
0 answers
47 views

Setting latest revision has been delayed

We are (still) using Drupal 8, the latest version, as a CMS for content editing. Our platform is huge and it has 100+ editors who are constantly adding/editing content, and also 20 importers which are ...
0 votes
0 answers
71 views

Geofield -> Filter points inside a polygon

I have two content types. Each of them has a Geofield field: A -> It has a Geofield of type polygon B -> It has a Geofield of type point I would like to build a view to show all B nodes that are ...
0 votes
0 answers
50 views

How can I show tax per line item at checkout?

In D7, there was a module named 'Commerce price by components' which allowed us to display a price inclusive or exclusive of tax. I would like to show a detailed tax breakdown at checkout as most of ...
  • 195
1 vote
0 answers
67 views

How to show progress bar twice on one request (with Batch API)

I have a custom form which handles two different process after submission, let's say Process 1: removing all article nodes Process 2: importing article nodes from csv. The problem is that each ...
  • 179
0 votes
0 answers
27 views

How do I dynamically add filters?

I have a view_block with the following filters, I want to change the product tag, Release tag, Document type values dynamically based on url. if the url is, example.com/mars/21.43.00/ProductGuide, ...
0 votes
0 answers
19 views

Can't upgrade Webform from 5.x to 6.x: "Entities exist of type Webform submission and Webform"

I recently updated my site from Drupal 8.9.19 to 9.2.8, and from Webform 8.x-5.28 to 6.1.0. I'm now trying to deploy this update to my test server, and I'm getting the following error when running ...
0 votes
0 answers
24 views

How to add contextual filter?

I am working with books in drupal 8. I want to display a specific page("table of contenets") on the sidebar whenever any page of that book is accessed. "table of contents" is a ...
0 votes
1 answer
28 views

Add default value to existing field

I have tried to add default value to an existing field using hook_form_alter() but it does not work. Below is the html of the fields <fieldset class="js-form-item js-form-type-textfield form-...
's user avatar
0 votes
0 answers
12 views

view and context variables does not get passed on VBO custom execute action

I have created a custom VBO action and below is my code for the customaction.php. The action is getting created perfectly fine, however the $view and $context variables are not getting passed through. ...
  • 33
0 votes
1 answer
58 views

How to stop duplicates caused by date range in views

On my site I have a content type called Course. Courses can have several sessions. To display these sessions I am using the date range. When a course has more than one date range entered an instance ...
  • 115
0 votes
0 answers
58 views

How to get user custom field in order email twig

I am trying to add user custom field in order receipt pdf using below file commerce_purchase_order under template. commerce-order-receipt--purchase-order-gateway.html.twig I tried below code {% ...
0 votes
1 answer
154 views

Programmatically getting variation type fields in order

I am trying to get variation type field values from the order entity but I can't find any documentation on this. I am using an event subscriber to run the following code when an order is paid. The ...
  • 141
0 votes
0 answers
27 views

Message Subscribe is ignoring flag and sending notifications to everyone

I'm developing a Drupal based forum and I'm using the Message stack modules combined with a tweaked version of this custom module. https://github.com/Lullabot/message_integration The idea is that all ...
0 votes
1 answer
77 views

Toggle view displays on the same page

There are 2 view displays (2 blocks) which are showing products, one with tile display, one with list display, as shown in the image below. Is there a way to have both blocks on the same page, but ...
0 votes
1 answer
24 views

getCommentedEntity returns null

I have a comments page set up and when I devel the page for a specific comment I see the getcommentedentity method. I am trying to get the commented entity details using the below code in my VBO ...
  • 33
0 votes
0 answers
50 views

Update body field from ajax callback

I need to update the common "body" field when I change some paragraph fields value. Here is my hook_form_alter : $form["body"]["#prefix"] = "<div id='...
  • 61
0 votes
1 answer
48 views

Upgrading to Composer 2 blocked by Symfony dependecies

I have an existing Drupal 8.9.16 site which uses Composer 1 (and Commerce 2.24). I am trying to upgrade to using Composer 2 using this guide: https://www.drupal.org/docs/develop/using-composer/...
  • 927
0 votes
1 answer
70 views

How to keep Contextual Filters (query) on Exposed Filter change

I have a view page that leverages Contextual Filters with query parameters. So when a user visits the view page, the URL is as such… /search?location=san+francisco. This works as expected. Now there ...
  • 76
1 vote
0 answers
27 views

URL aliases for non-translated content types revert to /es/node/nid in menu

I have Content Translate enabled and enabled translation on only our Projects content type. I've placed the Language switcher block on a Projects view and Project node page. This is working just fine. ...
  • 440
0 votes
1 answer
94 views

How to get the base URL of a site in Queue API?

I am trying to get the base url of the drupal 8 website in a queue process but I am getting http://default as the base url. What am I missing here? public function testUrl() { global $base_url; ...
-1 votes
1 answer
34 views

Webform 6.1.0 help text not showing

I updated my webform Module from 5.3.0 to 6.1.0, I have one the Following Error: the help text isn't displaying its content on any form on my site (Example of help icon in the shared image) It should ...
  • 7
0 votes
0 answers
46 views

View injecting weird html elements (b element)

I've noticed recently that, in a drupal website I'm maintaining, a view displaying a list of content type called Event, has some weird html elements injected. This messed up the layout and I'm not ...

1
3 4
5
6 7
317