Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [8]

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

0
votes
0answers
4 views

.htaccess error on local site in docksal

I've built a Drupal 8.6.4 website within Acquia Dev Desktop, but moved it into a local Docker/Docksal setup to continue working (haven't used it before) - on a mac, if it matters. Everything seems ...
0
votes
0answers
11 views

Grandchild Pathauto from Nodes

I have a node that has a parent_field (entity reference) that if left empty, that node is a parent. If parent_field has data (ie the nodes parent node name) then I can easily add pathauto in there ...
0
votes
0answers
11 views

Rebuild menu after adding a menu item

I am migrating nodes from D7 to D8. For various reasons I am writing my own code to do this. The migration will run on a couple dozen different sites so the solution needs to be as generic as ...
3
votes
3answers
38 views

Show if a user is online, idle, or offline on their account page?

I want to display the status of the user on the account page. I added the code below in the .theme file of my theme. It works, but users are never displayed offline. Why ? Is there a mistake ? ...
0
votes
1answer
22 views

How do I automatically generate image styles?

How do I automatically generate different image styles in Drupal 8, for existing images? For example, I have about 10K images in field_image field. I would like to generate thumbnails using my ...
0
votes
0answers
22 views

Can a taxonomy vocabulary entity be disabled or unpublished?

Vocabularies are config entities. I can see the delete link in the UI. In the example vocabulary config yml - taxonomy.vocabulary.blah.yml - uuid: 16ebbc47-16ac-461c-0000-00000000 langcode: en ...
1
vote
0answers
14 views

How to add autocomplete to text_format element?

How can I add autocomplete functionality to a text_format field? I want to do this because I'm trying to create a field which has both autocomplete functionality (auto-suggesting certain configured ...
0
votes
0answers
9 views

Page manager external URL has crashed UI

I accidentally added an external URL as my page URL in page manager. I'm now getting the following error and cannot get back into the Page Manager UI The website encountered an unexpected error. ...
0
votes
0answers
11 views

control views contextual filter; ajax

I would like to implement a view exposed filter that filters by Year. I need to use ajax. I do not want to create a new field that saves the year as a simple integer and instead use the existing built-...
0
votes
0answers
12 views

Can't select the layout in manage display configuration

I updated my Drupal site from 8.6.3 to 8.6.4. Now I can't select a layout for a content type in "manage display," as shown in the image below. The layouts are template files. Did something ...
-1
votes
1answer
29 views

What is the basic concept behind revisons in term of performance?

On a Drupal 8 project, I am planning to allow revisions to be created for one "content type" which consist of around 40 different fields ! Can someone explain the concept behind on how Drupal save ...
1
vote
1answer
19 views

How can I add field to the view?

I have created a view, which displays different content types. I have added some fields for dispalying (image, title, description). The issue for me is that not every node has an image. When it doesnt ...
1
vote
1answer
37 views

How to create URL alias for node edit page

Pathauto can create URL alias for node view page, for example, URL from node/nid to project/nid (project is a name of content type), but the link to the edit page is not /project/nid/edit, but /node/...
1
vote
0answers
21 views

entityQuery where a translation with a different value returns incorrect nodes

The title seems a bit odd, I know, but I couldn't find any issues similar to this and that's the best I could come up with. We are running into an odd instance of entityQuery returning nodes that ...
0
votes
0answers
29 views

Subscribe to content type creation event

I'm using Drupal 8 (8.6.2). My main objective is to read fields of newly created content type (or changed, it doesn't matter) and create few helper data structures. To achieve this, I'm trying to ...
0
votes
2answers
35 views

Why can only administrators see blocks?

I'm using the Paragraphs and Block field modules to display a list of nodes within the content of a page. This works great while authoring, but as soon as I log out from the administrator account, the ...
0
votes
1answer
14 views

Sum the value of all nodes fields and display them on the taxonomy page [on hold]

How to get result like on the picture? I created taxonomy term - Coins with two nodes. A field_coin_price is attached to the nodes. Using the View I can easily display the number of coins (nodes) on ...
2
votes
2answers
41 views

Rendered Webform has no Javascript attached

I've created a simple filter that allows webforms to be rendered anywhere in a node with a tag like this: [webform:machine_name] The code to render the form is as follows: $webform = \Drupal::...
-2
votes
0answers
25 views

Migration of commerce module?

I am trying to migrate Drupal Commerce module from Drupal 7 to Drupal 8. The issue i am facing here is that, in the product content type i have added product reference field. While trying to migrate ...
0
votes
1answer
24 views

How to display form element and label inline

This must be simple, but I cannot find the answer. I want the label and the textfield on the same line. I tried this: 'odt-filter' => array( '#type' => 'textfield', '#title' => 'Filtra',...
0
votes
1answer
24 views

How to get the language code when language name is given

We are creating nodes programmatically on submitting a form. The language of a node is an input value in the form. How can I get the langcode, when I have the Language name? For example, user may ...
-1
votes
0answers
20 views

How to move field existing content to new field using field collection?

How can I use field collection module from existing field content in drupal 8. I had migrated content from Drupal 6 to Drupal 8 and how can I use field collection. In Drupal 6 I use CCK module to do ...
-1
votes
0answers
18 views

Embed custom form in paragraph

So i have a custom form (it's similar to an email subscription form) in a custom module, i need to create a new paragraph and have that form be the content of the paragraph. Any ideas? Drupal 8.6.1
1
vote
1answer
25 views

Configuration form confirmation

I have a configuration form which extends ConfigFormBase. How can I add a confirmation popup/page to give a message to the user that some field has certain value and do you wish to continue form ...
0
votes
0answers
13 views

Enable block visibility settings within Context

Are there any documented/known ways to enable block visibility settings within Context? I've got a case where I have separate contexts set up for each site language which define the menu blocks that ...
5
votes
1answer
99 views

`composer require` fails because “Source directory docroot/core has uncommitted changes”

Symptom: You have a script that fails while executing a composer require command, resulting in output like the following: $ ./example.sh Gathering patches for root package. Removing package drupal/...
1
vote
0answers
9 views

Create a view of nodes that are not referenced in any entity reference field of another content type

How can I create a view of nodes that are not referenced in an entity reference field assigned to another content type? I have a Profiles content type and a Publications content type. The ...
0
votes
0answers
27 views

Programmatically change the required state of a field

I need a field in a content type to be required but only based on the value of another field. I'm trying to enforce this via hook_node_presave but I'm not sure that's the right hook to use for this.....
0
votes
0answers
12 views

How to send an email to an user after user account field is edited?

I created a paragraph field with "Title", "File", "Observation" and "Approved" (only mods and admin have acess to this field) and attached it to a user account. The user has acess to the form that ...
0
votes
0answers
14 views

Show the nodes number of a parent taxonomy term?

I have parent taxonomy term (Coins) and a few child terms. Coins Dollar Half dollar 1 cent I show the number of nodes in a current taxonomy term using next method. Create a Taxonomy Term view (...
0
votes
1answer
29 views

Slide effect with JQuery

I'm not very good with Javascript/Jquery, and I don't understand something. I display a full size image when the user arrives for the first time on the homepage. If the user scrolls, the image ...
0
votes
1answer
20 views

View using Path

I'm having an issue combining the use of taxonomy terms, URL alias patterns and views. Here's my setup: 1) Taxonomy: A basic taxonomy, lets call it "Blog Tags". In here I have a term like Mountains. ...
0
votes
0answers
22 views

Mail system strips out HTML tags [on hold]

I have workbench module which will send automated mails to editor once contributor submits node for review. I have installed below module form mailing feature. But still its strips all html in the ...
1
vote
0answers
26 views

Apply constraint conditionally

I've just started to use Drupal 8's Entity Validation API and I'm applying constraints to entities in the following way using hook_entity_bundle_field_info_alter: ...
1
vote
1answer
34 views

Get form values into hook_node_insert / hook_node_update

I need to get in hook_node_insert and hook_node_update the value of a field I manually added to a form. function hook_form_FORMID_alter(&$form, FormStateInterface $formState, $form_id) { $...
0
votes
0answers
15 views

How do I add moderation state in a computed field?

I have a D8 content type with content moderation (draft,published, in-progress). I created a computed text field (my_computed_field) and want to add the current moderation state in the field.
0
votes
0answers
17 views

Permission to edit and delete own terms in drupal 8 [on hold]

I am using drupal8 (core:8.6.3) and contributed module: private_taxonomy (version: 8.x-2.2). I found the permission (edit and delete own terms from private vocabulary) not worked, any authenticated ...
3
votes
2answers
527 views

Create styled image programmatically

I have a module that create custom PDF with multiple selected nodes and I use the below function to create the link to styled images: $file = File::load($img_id); $imagesPath[] = ImageStyle::load('...
-1
votes
0answers
30 views

How to limit the product customization of a store type?

I have several types of store on my site and I want to modify the button "Add to cart" of all products associated with a type of store: I want to replace the text of the button "Add to cart" by "...
3
votes
1answer
45 views

How to add autocomplete to a textarea on a form?

I would like to add autocomplete functionality to a textarea form element in Drupal 8. I have a fully functioning custom textfield which has autocomplete working on the same form. I have confirmed ...
0
votes
0answers
20 views

What to do when Drupal can't check for updates? [duplicate]

I am trying to check for updates using the core update module but I keep getting this error: There was a problem getting update information. Try again later. I am checking from /admin/reports/...
-1
votes
0answers
25 views

Use Token in twig template

I would like to use the token [paragraph.field_zwischenseite_link] in my twig template to link my parent div. Unfortunately I get the error Message "The website encountered an unexpected error. ...
0
votes
0answers
33 views

How to prevent views to replace single quotes with double quotes in HTML output?

I'm using the rewrite option of a view field to generate some HTML. One tag has a data attribute, which should contain an array for later use in JavaScript with JSON.parse(): <div data-image-src='[...
0
votes
1answer
23 views

EntityReferenceSelection plugin ignored

I am trying to create a simple time tracking app and for this purpose, I need an entity reference field with some additional filtering of referenced entities (only active projects can be selected). I ...
3
votes
0answers
41 views

Multiple source items per row

I'm migrating content from a Joomla SQL source. The images are stored inside of the text as inline images. This is how my source data looks like: +------------+--------------------------------------...
1
vote
1answer
19 views

How to create a view to count comments per user?

I am trying to create a view with a table that shows all the users and the total number of comments that user posted in descending order. I am not sure what I am doing wrong but I spent hours on this ...
0
votes
1answer
52 views

How to pass values or data from a page to a webform using webform link field?

If we have a link to a webform in a content type and we need to pass data or values to that webform from the fields available from the content type. How do we achieve this. I'm using webform 8.x-5 I ...
0
votes
0answers
32 views

View Fields twig: How to get taxonomy terms for field?

I have a view fields hook that is listing content in twig. From those fields, I am able to retrieve other fields like text. {{ fields.field_teaser.content }} I am unable to get the taxonomy terms ...
0
votes
0answers
53 views

How to export images [closed]

What I try to do is to transfer some nodes from a d8 site to another d8 site. I tried the node export module though is still in development. My problem is that I can't pass the images from image ...
0
votes
1answer
21 views

Show multiple term references as ID in one row

I've got a view of nodes, displayed as fields. As each node may have references to multiple terms/tags, I would like to show all these tags. When I use field "term_node_tid", then I get the multiple ...