A message from our CEO about the future of Stack Overflow and Stack Exchange. Read now.

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
0
votes
1answer
8 views

Drupal 8 - Paragraphs library item field doesn't show up the remove button

I am using paragraphs and paragraphs library module in my drupal project. The paragraph (Paragraph A) has a text field (unlimited). I don't see a remove button on the field. I only need one item for ...
-4
votes
0answers
18 views

The “list_key” plugin does not exist

While add a new field from manage display, i am getting this below screenshot error. I am using drupal 8.8.1 and PHP 7.2. i searched but not sure why this issue come.
0
votes
1answer
9 views

How can I show the latest added content to a specific link?

I have content type Videos, lets say I have 5 videos, they have these url links: /videos/video-name-1 /videos/video-name-2 /videos/video-name-3 /videos/video-name-4 /videos/video-name-5 What I want ...
-1
votes
2answers
36 views

Convert machine to human readable node type on page--node--add.html.twig (twig template variables)

I tried to create a variable on hook_preprocess_page to achieve it, but I'm only getting the machine readable name so far. $variables['node_type'] = FALSE; if ($current_path = \Drupal::service('path....
1
vote
1answer
20 views

Variables are missing on page--node--add.html.twig

I have created two templates page--node--edit.html.twig page--node--add.html.twig I have discovered that the {{ node }} and {{ node_form }} variables are missing during node creation. Here is my ...
1
vote
1answer
36 views

How do I re-save all users?

I need to re-save about 300 user to initialize geo-coding on their address fields. On /admin/people, I don't see any bulk action that would fit my needs. I have tested the update path-alias but with ...
0
votes
0answers
27 views

Hook into password change on user update

Question in short: How do I hook into password change in order to get plaintext old and plaintext new password when password change is accepted? What I have tried so far: I tried hook_form_alter with ...
0
votes
0answers
20 views

Reset password single login link no longer valid

In a Drupal 8 project, when trying to reset password, the single login link is successfully sent to the entered email address but when clicking that link it always print the following message event ...
1
vote
2answers
27 views

How to show a block between the body and a paragraphs field?

For a larger article content type on a Drupal 8 page, I want to have the following structure: Title Image/Video Body (the normal node body with the title and some text) A contanct block Paragraphs ...
0
votes
1answer
16 views

How to print rest of the form using “without” function in twig while printing custom user field present account array?

I am writing custom template to style my "edit user profile" form page. Below is the code in twig file : {{ form.first_name }} {{ form.last_name }} {{ form.account.mail }} {{ form.account....
0
votes
1answer
17 views

Call another field inside preprocess_views_view_field

how can I access the value of another field inside the preprocess_views_view_field. This is an example: function THEMENAME_preprocess_views_view_field(&$variables) { $view = $variables['view']; $...
1
vote
1answer
23 views

How to add /admin/people as a tab to a custom menu?

In a custom module (association), I ceated views that are accessible thru tabs: The paths are defined in the views; Adhérents et personnes -> /association (this one is also defined as a menu item) ...
0
votes
0answers
16 views

How to display register forms in the form of tabs?

I have two registration pages register_one and register_two. I used the multiple_registration module for creating register forms. Now I want to display two register forms in the same page in the form ...
0
votes
1answer
27 views

Alter Existing Route - Bypass/override entity permission

I added a custom access check to a JSON API endpoint so that only users who provide a token can POST/PATCH updates on a media endpoint. I followed this documentation in order to alter an existing ...
0
votes
1answer
15 views

Custom Drush command and Config::get()

how can I access site configuration when in Drush command? Global variable $config === null and when I use Config::get('key'), I get Error: Using $this when not in object context in Drupal\Core\...
-1
votes
0answers
47 views

How do I avoid Twig is cached? [duplicate]

The following code is used to display whether the users are online, absent, or offline. My problem is that the current date "timestamp" is cached, so there is no change in user status unless I ...
0
votes
0answers
17 views

403 forbidden error in vhost

I have a problem with Apache 2.4 and a Drupal 8 site. I get a 403 error only with the default .htaccess file Drupal 8 has. It only works after I put Options +SymLinksIfOwnerMatch in the .htaccess ...
0
votes
0answers
23 views

How to dump $form in twig template of custom form?

I am trying to debug $form values on twig template, created for rendering user edit form in my own way but when I am trying to use {{ dump(form) }} or {{ dump($form) }} browser hangs and then system. ...
0
votes
0answers
12 views

How to use migration to update field content ant not replacing if it already exists?

In a custom module (assoc), I have a custom Content Entity (Member). I migrated Member content from a Drupal 6 site using Migrate Source CSV, Migrate Plus, Migrate Tools and this migration file: id:...
0
votes
0answers
32 views

How to let users remove a specific field or fieldset on a custom form using the form api?

I followed this Drupal example: https://git.drupalcode.org/project/examples/blob/8.x-1.x/form_api_example/src/Form/AjaxAddMore.php I've edited the code a bit to use fieldsets instead of just one ...
0
votes
0answers
16 views

“Warning (table id = 'datatable'): Cannot reinitialise DataTable” [closed]

I use the DataTables module with Drupal 8 I always get the following error. DataTables wanring (table id = 'datatable'): Cannot reinitialise DataTable To retrieve the DataTables object for this ...
0
votes
1answer
28 views

Get field value and label for a content type using REST API

I need to create a REST API endpoint with GET operation in Drupal 8. The API should return all fields of a given content type. Right now I am only able to fetch the title. Also, I am not supposed to ...
-2
votes
1answer
31 views

How to disable admin approval for user registration?

I've two different register forms: a_register and b_register. To achieve this I've use multiple registration module which is working perfectly fine. Now my question was if any user register on any of ...
1
vote
1answer
16 views

How to send HTML email using Rules?

Does anyone know how to send HTML email using Rules? This was a pretty common task in D7 and I think the rule was included with the mimemail module. The D8 version of mimemail doesn't appear to have ...
2
votes
2answers
56 views

What good is the create() method? [closed]

Most classes are instantiated using create($container) and __construct(...$services) in conjunction, it seems that the more efficient workflow would be to simply pass the container to the constructor ...
1
vote
2answers
151 views

How to use custom class methods in the .theme preprocess functions?

In a try to get code cleaner, I thought I could write a service in a custom module and use its methods within mytheme.theme, but obviously the preprocess functions signatures don't accept extra ...
0
votes
2answers
37 views

Connection issues

New to Drupal 8 and tripped up on this one. It seems something wrong with database but if anyone has tips please let me know! Here is my code: and here is error: And my drupal site isn't working at ...
-1
votes
0answers
26 views

Adding custom image of search item

How we can pass the custom image on search page in d8. I have created custom_theme_preprocess_item_list__search_results function in .theme file but I am not getting node details here, I am getting ...
2
votes
1answer
32 views

How to suppress “page not found” messages in watchdog

The issue Add an option to suppress page not found watchdog messages at https://www.drupal.org/node/2836458 indicates that a setting was added to Drupal 8 to suppress page not found errors in watchdog....
1
vote
1answer
22 views

Render media url in node--page.html.twig

I have an Entity reference field field_video. It's a core Media field with a Reference type of Remote video. Because I use this field_video in my Hero section I need some additional markup here. ...
4
votes
2answers
144 views

What is the correct way to update my cached block when a node of a given type is saved or updated?

I have a custom module with a block plugin: SliderBlock.php class SliderBlock extends BlockBase { public function build() { $build = []; $build['#theme'] = 'slider_block'; return $...
1
vote
0answers
22 views

Update field properties defined by hook_schema()

I'm probably a bit confused by documentation. Got a custom field with some properties defines in hook_schema() : /** * Some field type. * * @FieldType( * id = "field_selector", * label = @...
1
vote
1answer
26 views

composer require error: can't delete default.services.yml

using Drupal 8.8.1 composer require drupal/{{ any package }} returns Installation failed, reverting ./composer.json to its original content. [RuntimeException] ...
0
votes
0answers
26 views

Migrate into paragraphs without parent import

If I have a data source with some values, can I process those into a paragraph attached to a node in Drupal 8 without having to run a prior migration to create the paragraphs first (and then relying ...
1
vote
0answers
14 views

Customizing the checkout form

I need to fill Billing Info form with data that the user has filled in another page of my commerce site. I've made a hook_form_alter with the following weird code (with the help of kint): function ...
1
vote
1answer
30 views

adding new validation method using HookEventDispatcherInterface::FORM_ALTER event

I'm trying to add a new validation method for 'user_login_form' using HookEventDispatcher module and events: class MyFormEventsSubscriber implements EventSubscriberInterface { public static function ...
0
votes
1answer
64 views

Update Symfony components

There are many posts and articles that make vague references to upgrading Symfony 3 to Symfony 4 in Drupal 8. But nothing specific. For example this one by Ryan Weaver "Symfony 4 and Drupal" I've ...
0
votes
0answers
12 views

Custom views filter plugin: cachetags invalidation does not effect option list

I described a custom views filter plugin extending InOperator. The aim is to offer a select list where the user can choose from a list of fractions of a legislature. Legislature and fractions are ...
2
votes
1answer
41 views

How to get total number of rows on a block of a view

On hook_block_view_alter() I need to get a total number of rows that this block displays. For example, I have a view with the following block: On hook_block_view_alter() I do the appropriate checks ...
1
vote
0answers
25 views

Hook form alter not working for node edit form

I have a content type called landing_page. If I edit an existing node in the admin /node/31/edit and I inspect the form I see id="node-landing-page-edit-form". I can't get it to work to use ...
0
votes
1answer
66 views

Cache a block by a custom entity rendered within

I struggle with getting a custom block cached correctly: we have a custom entity "Politician" For that entity we have several routes where we want to render a "politician header" with some basic ...
0
votes
0answers
13 views

Views contextual filter allow multiple values not available

I'm building a view to see some webform results. I'm trying to add a contextual filter to limit results to certain values entered in a field, but the option to allow multiple values is not allowed. ...
-1
votes
0answers
22 views

Form wrapper is missing when rendering indididual components on page--node--edit.html.twig template

Form wrapper is missing when rendering indididual components on page--node--edit.html.twig template Using hook_preprocess_page we are able to create variables for form like $variables['node_form']...
0
votes
0answers
28 views

Alternative for Code Per Node on Drupal 8

I'm looking for an alternative to the Code Per Node module on Drupal 8. I've tried Asset Injector and it has an issue that deletes all configuration files whenever the caches are cleared. Does anyone ...
-3
votes
0answers
31 views

How to generate a number for Drupal Commerce SKU?

I have a site on Drupal 8 and Commerce 2.16 with a marketplace (several merchants with several stores). Each merchant can fill in the SKU field with their product variations. The problem is that the ...
0
votes
1answer
60 views

Render paragraph reference field in page.html.twig

In page.html.twig I want to show a paragraph reference field which contains a left and right text_field. The name of the reference field in the node is: field_intro. That field is linked to a ...
0
votes
1answer
19 views

More options for page--node--edit.html.twig for content type

Using my Theme debug I'm getting the following themplate suggestions page--node--blogpost.html.twig page--node--edit.html.twig When I tried to use different template to edit a blogpost template ...
0
votes
1answer
22 views

Can we access paragraph field in views-view-unformatted.twig?

Is there a way to access the fields in paragraph in views-view-unformatted.twig. I want to perform checking on field of paragraph before print the row something like this {% for row in rows %} {% ...
0
votes
0answers
30 views

Configuration Import Error

I have a drupal8 in local system. I want to import my production environment configurations into my local. So i am running drush cim -y I got the following error. Unexpected error during import ...
0
votes
0answers
13 views

Theme suggestion for file link in on commerce product page

I'm listing some files for download on a commerce product page and I want to customize the output. I'm trying to get a theme suggestion for file-link.html.twig but I'm failing to get them to work. I'...