Questions tagged [drupal-8]

Drupal 8 is the Drupal version that was officially released on November 19, 2015. Rather than using this tag, consider posting your question directly on https://drupal.stackexchange.com/.

Drupal 8 introduces major changes, such as the support for HTML 5, better support for web services, multi-language support, mobile devices, and a configuration API.

Use this tag only if your question relates specifically to this version.

Requirements

  • Web server: Apache, Nginx, or Microsoft IIS
  • Database server: MySQL 5.5.3/MariaDB 5.5.20/Percona Server 5.5.8 or higher with PDO and an InnoDB-compatible primary storage engine, PostgreSQL 9.1.2 or higher with PDO, SQLite 3.6.8 or higher
  • PHP: PHP 5.5.9 or higher

Related tags:

Resources

2837 questions
5
votes
1 answer

Issue for a "two dimentionnal 'add another item' " with FormStateInterface::getTriggeringElement()

I'm learning drupal 8. I want create a page who contain a 'two dimensionnal' 'add another item' form. My code works well almost, but I have a strange behavior when I add rooms to a house (there is a strange value in my debug logs from the…
spacecodeur
  • 2,206
  • 7
  • 35
  • 71
5
votes
2 answers

Drupal 8 Twig Template: get relative or absolute path from URI

I have in a twig template an image url, like "public://path/to/image.png". I want to get "sites/default/files/path/to/image.png" to use it in the template. I thought it should work with something like this: {{ url ('public://path/to/image.png')…
user2735442
4
votes
2 answers

Drupal 8 - Get All Nodes With a Part of Url Alias

I try to find a way to get all nodes by a part of the url alias in the nodes. I know i get a specific node by the complete url alias. For example: $path =…
wiifree
  • 55
  • 1
  • 7
4
votes
1 answer

Drupal 8 how to alter paragraph form?

In drupal 8, I'm using paragraph in node. It's working fine but I got stuck to alter paragraph form. I want to hide one field on base of other field value. Please help if somebody worked it on before
Sourabh Bhutani
  • 623
  • 11
  • 21
4
votes
0 answers

Optimizing javascript/jquery code for loading form in a popup

I want to load drupal form in a popup, i create this function and it works just fine, the problem is that it takes forever to load ( more then 8s ).My question is how to optimize this code so that it load faster. // Attach a click listener…
4
votes
1 answer

JavaScript returning array length of 0, but correct length in console

I have an HTML page with this block below. I cannot change it. In JavaScript, I want to find all these a elements of class language-link and get their hreflang attribute, so I did this var lang_links =…
Chris Rahmé
  • 357
  • 2
  • 6
  • 20
4
votes
1 answer

The "paragraph" entity type does not exist. in Drupal\Core\Entity\EntityTypeManager->getDefinition()

On Drupal 8.8.8 with paragraphs:^1.12, getting this error: The "paragraph" entity type does not exist. in Drupal\Core\Entity\EntityTypeManager->getDefinition() Same error with other versions of paragraphs.
Paul Croarkin
  • 14,496
  • 14
  • 79
  • 118
4
votes
2 answers

A client error happened - Drupal 8 REST API Post method

While i call Drupal 8 custom rest API post method, i am getting below error. please help to me resolve this i struggle last 4 days.
Ambal Mani
  • 295
  • 1
  • 5
  • 16
4
votes
1 answer

In Chrome the currentSrc of an img element is sometimes empty. How can I prevent this?

UPDATE: I just found some more info. It seems that in Chrome, the currentSrc of the image will often be empty, whereas in Firefox, the URL is always correct. Is the JS trying to access currentSrc before it's available? Is there a way to prevent…
4
votes
2 answers

Drupal 8 PHPUnit testing custom modules

I am trying to find out why my PHPUnit tests fail with the following messages: PHP Warning: Class 'PHPUnit\Framework\MockObject\Matcher\InvokedRecorder' not found in /var/www/html/core/tests/bootstrap.php on line 197 Warning: Class…
sisko
  • 9,604
  • 20
  • 67
  • 139
4
votes
0 answers

Rules - how to check if user has role(s)

In the module Rules, I try to check if a user has role(s). So, I add a condition "User has role(s)". In the field "Data selector" (in data selection mode), I add node.uid.entity, in the field roles, I add my roles ("seller, "buyer"), in the field…
Philalawst
  • 168
  • 1
  • 10
4
votes
2 answers

How to change the color of a Bootswatch theme?

I have a Drupal 8 site with the following Bootstrap 3 theme : https://bootswatch.com/3/flatly/ This theme is very good but the colors do not match my site. I like the colors of the following theme : https://bootswatch.com/3/sandstone/ How to put the…
user12030855
4
votes
1 answer

How to update my View in Drupal 8 without scrolling back to the top?

I'm trying to refresh my View in Drupal 8 without reloading the page with this code : (function ($, Drupal) { 'use strict'; setInterval(function() { $('.view-message-activity-stream-timeline-public').trigger('RefreshView'); },…
tropcool
  • 141
  • 2
  • 10
4
votes
0 answers

Environment specific database connection configurations in Drupal 8 Settings.php

I am trying to pass environment variables to settings.php file for database configurations in Drupal, I am able to access the environment variables and store them to variables and pass those variables to database array in settings.php If i print the…
Comsciers
  • 154
  • 11
4
votes
1 answer

Drupal composer requirements could not be resolved to an installable set of packages

I am having troubles updating Drupal from composer. Running composer update gives med this error, that I need help to interpret: Loading composer repositories with package information Updating dependencies (including require-dev) Your requirements…
topstash
  • 98
  • 9