Questions tagged [8]

Version tag to tag issues specifically related to Drupal 8.x. Please note that 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
1
vote
2answers
445 views

Why is my library not attached when programmatically rendering a block?

I have this block: public function build() { $build = [ '#attached' => [ 'library' => [ 'mymodule/mylibrary', ], ], '#markup' => '<!-- see template -->...
0
votes
0answers
20 views

Updating entities/posting data via ajax?

I've got a handful of entities that need to updated on user interaction, such as: Tracking user progress through a video, such that a listener checks playhead position every x seconds and posts ...
1
vote
0answers
167 views

Drupal 6.37 to 8.2.x upgrade with drush fails with 1115 Unknown character set: 'utf8mb4'

I am upgrading a legacy Drupal 6.37 site running on mysql 5.1 to a fresh install of Drupal 8.2.1 with mysql 5.7.16 on a remote host. I have installed the migration modules required for drush and am ...
0
votes
2answers
202 views

Custom (cck) fields are being ignored during the migration using migration-tools 4.x. Only title and body is imported. How do I fix this?

I'm running a migration from Drupal 6 to Drupal 8, following roughly the advices in the http://pnijjar.freeshell.org/2017/drupal8-migrate/ guide. At the moment, only title and body for each node is ...
0
votes
1answer
266 views

Migrate Alt and Title text from a D6 image file field to D8

I'm trying to migrate a multi-value D6 image field to D8. I've already migrated the files with d6_file and it worked. When I do the node migration with the image field works and I get all the values ...
0
votes
0answers
53 views

Drupal 6 to 8 upgrade modules

I'm upgrading the Drupal 6 project to Drupal 8 using drupal migrate UI module. I've installed the below modules in Drupal 8 for an upgrade from 6 to 8. Nice Menus Views Slideshow But, those are not ...
1
vote
1answer
201 views

Drush Migration between distant DB and local DB? [closed]

I'm trying to set migrations between an online D6 website and a local D8 one. So I want to connect to D6 DB like this: drush @vmdevd8ce migrate-upgrade --legacy-db-url=mysql://d6dbuser:d6dbpass@...
0
votes
1answer
452 views

How to use a terminate kernel event to log page access statistics?

In Drupal 7 hook_exit is implemented in the Statistics module to gather statistics for page accesses. This change record suggest the equivalent in Drupal 8 is to listen for kernel.terminate events. ...
23
votes
6answers
30k views

Iterate through multiple value content field in Twig template

I need to take control over the rendering of a field_admin_tags field in a node.html.twig template. This WORKS: {{ content.field_admin_tags }} — Renders everything (label + all field values) {{ ...
0
votes
2answers
28 views

How to use views filter criteria in a custom exposed view filter?

I am using Drupal 8.7.11 and have created a custom views exposed filter which provides users the option to filter an entity reference field using a checkbox list of names instead of autocomplete. At ...
1
vote
3answers
2k views

How to make Drupal 8 forget an old deleted field?

After deploying a Drupal 8 site to a new server, we have the problem of an old deleted field being remembered by some subsystem or other, leading to this error being thrown on whenever cron runs: ...
0
votes
1answer
25 views

Display fields from a paragraph as a single field

I have a paragraph which is essentially a date range, however, the individual dates can have prefixes, suffixes, can be in differing formats, I have a dropdown to select the format and dates need to ...
0
votes
1answer
30 views

Reverse paragraph tag order [closed]

In my multilingual site I have created a custom block with some information. One of that information is the following paragraph tag (p): (+34) 123 456 789. When I switch to Arabic language (LTR ...
0
votes
0answers
29 views

How to revert views

I had a working view. I have tried to modify it by removing the the relationships then it crashes. Now I am not able to edit the view. How to revert back the previous changes of view. Here is the ...
0
votes
2answers
800 views

Responsive background image in Twig template

I would like to render an image as background image in my Twig template. To optimize my resources I'd like to use a responsive image but I cannot find a way to use it for background images. For a ...
0
votes
0answers
23 views

Exposed Taxonomy filter relationship with two levels

I have searched about that but I didn't found any solution for my problem, I also tried to combine different solutions that I found but didn't work. Those solutions were different combinations of ...
1
vote
1answer
524 views

Default 404 page not working

In a Drupal 8.5.3 installation I have set up the following configuration: I created a basic page, its node path is /node/42. Under Administration » Configuration » System » Basic site settings (/...
2
votes
1answer
762 views

JSON format for creating users with custom fields using services

I am using Services module to register new users. My registration form has some custom fields like text field, radio buttons and select list. The following is the data I am sending: { "name" : "...
1
vote
2answers
78 views

Fetch view results from mymodule_preprocess_page hook

We have a View page that is coming from myview. Using the header setting in the view we have added @total results already, which displays in the views-view--myview--page-1.html.twig using the {{ ...
0
votes
0answers
28 views

select distinct articles in views not working

I am trying to remove the duplicate selected article. Even though my filters are simple and direct I am still getting duplicate articles Here's screenshot of my view Attempts I used: 1. I have ...
0
votes
0answers
11 views

How does Drupal.org test bot work with indexs?

When I upload a patch to a module on d.o I get the following errors across all tests : 1) Drupal\Tests\commerce_pos_keypad\FunctionalJavascript\KeypadTest::testCommercePosForm Error: Call to a ...
3
votes
4answers
2k views

“Fields pending deletion” stopping module unistall - how to delete manually?

I'm getting a "Fields pending deletion" error when trying to uninstall the Dynamic Entity Reference module. I also cannot disable the module as the tick is greyed out (unless I'm missing how to ...
0
votes
1answer
31 views

Modifying twig file to show elements side-by-side

I am working on views with embedded filters and my resultant view fields have the below twig setup: {% set index = 0 %} <div class='row'> <div class="panel panel-default"> <...
0
votes
1answer
15 views

How to write SoapClient request which has basic auth in it?

Actually I need to implement SoapClient in Drupal 8. Following XML is Request: <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:typ="http://www.example.com/common/...
0
votes
1answer
27 views

Create a button with an icon in render array, that can be themed by arbitrary contributed themes

Drupal 8 does not use HTML button tag for creating buttons, it instead uses the input tag to create buttons. This works fine for most part, except for buttons which include an icon gets messed up by ...
0
votes
1answer
32 views

Impossible to update some modules via Composer

I've updated a D8 website from 8.7 to 8.8.1 with SSH and composer. For some modules (in SSH 3rd column is marked in yellow) it is not possible to update them. I understand that when they are marked in ...
1
vote
1answer
430 views

Where is the “Send mail to all users” action?

I installed and configured the Rules module. When I try to add a rule like notifying a new comment to all users, I do not see the Send mail to all users action. Is that normal? Is there any other ...
0
votes
1answer
876 views

Set permanent status for managed_file in theme settings

I'm creating some Drupal 8 theme and I need some additional settings for it. So, I have to add some managed_file field in theme settings. I have theme-settings.php file where I define this field and ...
0
votes
1answer
34 views

Ajax loader when facet is selected

When we add a facet block to the page, a filter is selected and the page starts to load the results. However there is no loading icon or indicator the change is being applied. When we check the page,...
1
vote
1answer
120 views

Is a custom entity type a content type, or can both at least be logically unified?

I am having a hard time understanding the term custom entity type. If it at all matters, I understood entity type itself to be a kind of "template" for content types. I became confused after reading ...
0
votes
1answer
14 views

How can we define twig template based on checkout flow in Commerce 2.x?

I am using Drupal Commerce 2.x. I try to build different twig templates based on the checkout flow. So, I use hook_theme_suggestions_HOOK_alter to register other theme suggestions. However, I can't ...
0
votes
1answer
369 views

How to print the relative url or node id for each referenced node in twig?

I am using paragraphs to render a number of nodes on a page. The nodes are obtained through an entity reference field called 'field_nodeslist' in my cards paragraph type. The cards are then rendered ...
0
votes
0answers
26 views

How to configure feeds module JSONpath mapping, when all information is on the same (root) level?

I would like to import content with feeds module with JSONPath extensible parser and create nodes of them. When I have a hierachical JSON with a parent, the mapping is working like a charme (e.g. ...
0
votes
2answers
27 views

How to get parent node from a attachment in drupal8 search api results

I have apachesolr index search with Search API attachments. In the results I get a link to the file but I would like to get a link to the parent node. I tried in the view but there is no such field ...
-3
votes
0answers
26 views

How to create Paragraph type and Paragraph fields programmatically in D8

Can anyone help me to create Paragraph type and Paragraph fields programmatically by clicking on the save button (in Drupal 8)....? I have searched a lot but couldn't make it. I have found many Drupal ...
2
votes
2answers
399 views

How to add custom page.html.twig for views page?

I have a view page with url and machine id search I need to add a custom page.html.twig for that specific view page so that it does not affect the rest pages. How can I implement it? I tried adding ...
1
vote
1answer
1k views

Why I cannot get translated entities

I wrote service to get all necessary data for my page. Now I wanted to load them with translations. But whey I try, I got error: InvalidArgumentException: Invalid translation language (id of ...
1
vote
0answers
12 views

Only show view/block on nodes with certain field value when using “Content: Has taxonomy term ID”

I've set up a view of related content that has a block display and 2 contextual filters: "Content: ID" with "Exclude" "Content: Has taxonomy term ID" with "Load default filter from node page, that's ...
1
vote
2answers
611 views

How to set and inherit variables within different twig templates?

I'd like to set a variable in my node.html.twig template: {% set title = label %} {{ content }} The content consists of one field visible only, which has it's own template: file-link.html.twig How ...
1
vote
1answer
1k views

Inline Entity Form validation

Created a content type and add taxonomy form in it using Inline entity Form module. So, the rendered taxonomy add term looks like : What I want to do is ADD CUSTOM VALIDATION to the "NAME" field. I ...
8
votes
3answers
9k views

Site UUID in source storage does not match the target storage

When I run drush cim -y on my staging instance of my site I get the following error: Drupal\Core\Config\ConfigImporterException: There were errors validating the config synchronization. in Drupal\...
0
votes
0answers
22 views

Webform REST skip validation for draft

I am posting a Webform via the REST API but I keep getting a response saying the fields are required. I have the form settings set to use drafts and can skip validation in Drupal. What do I need to ...
0
votes
1answer
38 views

How to show the status of a referenced webform in view of nodes?

My use case is a list of events and I want to show a label on the views item, if the event is already booked out. Therefore I would render the status of the referenced event registration webform. ...
0
votes
1answer
160 views

settings.php.lock error

I've been working on a Drupal 8 site for a month or so now and development has been progressing nicely until a week ago. It looks like the issues started at just about the same time that the website ...
-1
votes
0answers
36 views

Rendering template from within block [closed]

I'm trying to render a template from within a block in Drupal 8. I've followed tracks and read extensively about this, with no avail. I'm not able to see my twig template, the rendering block is empty....
3
votes
1answer
672 views

Calling a JS function after managed file has completed uploading

How can I call a JavaScript function after a file has completed uploading using the Drupal Form API (FAPI) managed_file element?
11
votes
5answers
17k views

How to print custom date format in Twig?

How can I print a custom date format in Twig? First of all my I am trying to edit the field.html.twig of the field called field_publication_date, in that file I find this variable {{ item.content }} ...
0
votes
2answers
50 views

How to set multiple arguments for views contextual filters from twig

Am using twig tweak module to render views from Twig file. I have pass multiple values for the country contextual filter in the view. I was able to pass single parameter like: {{ drupal_view('...
-3
votes
2answers
52 views

Popup message not coming

I am using the Popup After Login module to show a pop-up after the users log in. I want to display a Youtube video on the popup. The steps I followed after installing the module and enabling it are: ...
0
votes
1answer
41 views

Apply conditionally an image style on an User Profile page

At the moment the module “Image Styles Rules” is only available for drupal 7, is there another way to apply conditionally an image style depending on the aspect ratio of the image (portrait or ...