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.

Filter by
Sorted by
Tagged with
0
votes
1answer
473 views

ERR_EMPTY_RESPONSE during installation with PHP 7.3

I'm trying to install Drupal 8 with PHP version 7.3.0RC4. When I go to http://localhost it redirects me to http://localhost/core/install.php with the empty response error. I checked the Apache error ...
-1
votes
1answer
15 views

Redirect domain to www, but on subdomain do not use www

I have a multilanguage website. The main language is English and the second language is Spanish. I need to have all the traffic using this domains: English domain: www.example.com Spanish domain: es....
0
votes
0answers
18 views

Enabled Text Compression

We would like to enable text compression for our sight. We tried to look, but could not find any contrib modules that do this. We are already using advagg to compress the JS/CSS files. It does not ...
0
votes
0answers
24 views

View bulk operation not respecting user permissions

Created two content type Type-A and Type-B Created user role "Editor" Editor have access to delete only Type-A nodes but not Type-B nodes Created Views landing page of these nodes with bulk operation. ...
-1
votes
1answer
122 views

Redirect to a form with an array of Terms as a parameter of buildForm

Here is my use case: 1-I select few nodes from a view with VBO 2-I run a custom action on those nodes 3-As a result, this action create an array of Terms ($resultedTerms) My goal, after that, is ...
0
votes
1answer
24 views

Pass selected values to node add form

I have a view of nodes. I'd like to be able to select rows (thinking VBO is the best) and pass those selected nodes to a form (specifically /node/add/payments) to pre-populate entity references. ...
0
votes
2answers
343 views

How do I update the unit price of an order item on Add to Cart in Commerce 2.x?

I added an event subscriber for add to cart event. There I defined a function to react on add to cart event. Everything works fine as my eventsubscriber is being called. I want to update the unit ...
1
vote
2answers
493 views

How to get alter value of a views field programmatically

I've developed a Views field plugin that extracts the value from another field in the view in order to apply some math. The plugin works great at getting the original value of the field. However, I ...
0
votes
0answers
50 views

Call to a member function access() on null in …BlockAccessControlHandler.php

I am getting two errors on my local Drupal 8 site. First error: "The website encountered an unexpected error. Please try again later." Second error: "Fatal error: Call to a member function access() ...
0
votes
2answers
448 views

Drupal 8 - Use the current node ID (on node edit form) to filter an entity-reference view as a contextual filter

I've got this view I just created, which lists all the events && publications related to a program (field_program, an entity-reference field) on my website (Drupal 8). Call it "...
1
vote
2answers
32 views

How do I change the Views (Entity Reference) filter via AJAX?

I have an entity form that allows an admin to select a content type (checkbox) and an autocomplete field that is tapped into a VIEWS Entity Reference (via the Reference Method). Goal: What I would ...
1
vote
1answer
1k views

Views escapes HTML tags in node body

I'm creating a view that displays a few fields from a specific content type. Among the fields is the trimmed nody body. The problem is that the HTML tags in the body are escaped and are visible as ...
0
votes
1answer
108 views

Batch API times out when running a single operation

I'm trying to print ~100 nodes worth of content (Performance Plans) out to the private file system using the batch API. My process works perfectly up until about 10 of them and then times out. The ...
2
votes
1answer
74 views

Drop UserMailRequired constraint

In my Drupal site, only administrators create users. And users are created without an email. Users can edit themselves some of their account fields, but the email is not one of them. But the user ...
0
votes
1answer
24 views

Restrict access to ECK full page, but allow embedded

Following the Lullabot article on how to embed anything in a wysiwyg with Entity Embed and friends we're using this to embed a custom entity type created with ECK (Entity Construction Kit). The ...
2
votes
2answers
582 views

How to manage patches in composer when they're merged into the module?

I'm building a Lightning BLT project and recently the deploy:build failed because the features module merged a patch composer.json was set to apply. Is there a way to indicate to composer that the ...
0
votes
0answers
18 views

Repointing a site a subdomain

I have created a new Drupal 8 site in a subdomain of an existing Drupal 6 site. The new site sits in public_html/dev - so the url for it is dev.mydomain.com. What is the best way to redirect ...
-1
votes
1answer
39 views

Site keeps redirecting to core/install.php

I keep having this problem of drupal redirecting to core/install.php as shown below: I already set the max_allowed_packet to 64MB on AWS RDS. I am not sure what else I am missing. Please help The ...
2
votes
1answer
746 views

How do I use API versioning?

I'm using the Services module to produce a REST API. According to the official documentation, there is a way to version services resources. I believe version here means supplying a single API (e.g. ...
0
votes
1answer
34 views

Add Button to Node View

I want to add custom button on node page. I tried with hook_node_view but it didn't show up. like this: function mymodule_node_view(array &$build, EntityInterface $entity, ...
1
vote
1answer
1k views

How to add twig code in View 'global custom text' field?

I want to add if condition in my "global custom text" field saying if node is published, print some link. I tried below steps , but it is not working: 1.I have added "Content: Publishing status" field ...
1
vote
3answers
4k views

How to get node url of selected language?

I have a node with an array of multiple languages. [19] => Drupal\node\Entity\Node Object ( [in_preview] => [values:protected] => Array ( ...
1
vote
2answers
506 views

How do I hide bulk operations form for a specified user role?

I have a view where I list user's own contents, this contains bulk operations. Users with "add article" permission can see this bulk operations thing but I would like to hide this bulk operations "...
5
votes
3answers
6k views

Documentation or Tutorial on using Batch or Queue Services API Programmatically [closed]

I am working on importing content into my drupal 8 website from an external API that returns XML data. The calls to the API take a long time to process. When I make too many queries at once it takes ...
4
votes
4answers
3k views

How do I structure the batch API array?

I'm working on a Drupal 8 custom module to scrape pages from a site for migration. Since we're dealing with a large number of pages, I wanted to set up batch processing, to deal with timeouts. I ...
1
vote
1answer
447 views

cannot use some drush commands

I am running into some trouble with drush I can't pm-enable the modules I just downloaded with it. I did some research but none of the solution worked for me, most cases involved switching "localhost" ...
3
votes
1answer
415 views

Is it normal that Drupal enters maintenance mode during a module update?

I have created a custom module with an .install file, which includes some hook_update_N() and hook_update_N(&$sandbox) update hooks. These are used to update a collection of existing nodes. ...
0
votes
1answer
113 views

Pass parameter to node twig template via url

The url to display node 100 is <site>/node/100. I want to pass a parameter to this node via the url. For example: <site>/node/100/3. Question: What must I do to get Drupal 8 to see /node/...
-1
votes
0answers
8 views

Send webform to selected Entity in 'wizard page' based webform

I have a content type Member with field Email. This member is used as field in webform, where anyone can select a specific member using Entity autocomplete field when filling webform. How can I force ...
1
vote
1answer
337 views

Preview template for node with custom template?

I have a custom content type, 'Article with Header' for which I have a custom twig template, 'page--article-with-header.html.twig', which manages the layout for this content type. When I preview the ...
2
votes
1answer
1k views

Clean urls not working

I just have Drupal 7 and 8 installed in my localhost on Opensuse Leap. With Drupal 7 I cannot pass the clean urls test, however the site is completely functional. By clicking the links on the menu I ...
4
votes
3answers
8k views

Programmatically set a datetime field

I already asked a question like this (Set date field in D8). Ok duplicate entry? NO! Now i have also to set a time and i'm using a array. My code looks like this. $field_array = [ ##begin of ...
3
votes
1answer
2k views

How do I programmatically remove a block?

I have a custom module that is intended to be deployed as a pure web view, with no styling whatsoever beyond what I created in the .twig file. I installed the Stark theme and in my local instance I ...
-4
votes
1answer
33 views

Send SMS after submitting webform [closed]

What is the best way to send an SMS after submitting a webform? I need to initialize the sms dependencies, but I skipped them for now. So far I have this, will that work? I did not test it at the ...
0
votes
2answers
26 views

Defaulting a value for a new boolean field added to an existing content type with content?

We have a Drupal 8 site. For one of our features, I added a boolean field called 'Pinned' to a our Blog Post content type. As I added the filed as a filter criteria to views, I noticed that, no ...
1
vote
1answer
450 views

Creating Parent-Child Entities

Is there a way to create parent-child entities in Drupal 8? I'm trying to create a structure where the top entity is for County, and the next level entity is for departments, and next level would be ...
12
votes
3answers
12k views

How do I create menu links programmatically?

I need to add some links to existing menu (or to new) programmatically in Drupal 8.
0
votes
1answer
350 views

Enable rest resource resource when module installs

I have a custom rest resource I have created within my module: /** * Provides a Demo Resource * * @RestResource( * id = "custom", * label = @Translation("custom"), * uri_paths = { * "...
-2
votes
0answers
24 views

Views Infinite Scroll won't work

I'm trying to add 'Views Infinite Scroll' module to my Drupal 8 website, but it won't work :( Configuration of my View: Yeah I've checked AJAX I've selected "Infinite Scroll" as pager and checked '...
1
vote
1answer
619 views

Create custom URL pattern

Using the pathauto module, we could have created custom URL patterns using the hook_pathauto(). I could not find any such way to achieve the same in D8. ref. https://envisioninteractive.com/drupal/...
0
votes
1answer
157 views

Paragraphs module decoupled structure

I'm looking to use the Paragraphs Drupal 8 module with a decoupled installation of Drupal 8 but would like the structure made in the admin area to be output in the JSON API responses. How can I ...
3
votes
4answers
3k views

CSS for specific pages

How do I add css for a specific page? For example I want the body background color to be different on a specific page than the front page. I've looked into hook_theme_preprocess() but am confused ...
3
votes
2answers
3k views

How do I add a node ID as class to the <body> tag?

In Drupal 7, there is a class like path-node-NID (with NID replaced by the node ID of the node being viewed) added to the <body> tag so we can easily add CSS styles to specific nodes. This is ...
0
votes
2answers
1k views

Images are not migrated and the body field is empty

I tried to migrate a site from Drupal 7 to Drupal 8.1 using drush (migrate-import --all) and the following modules: Migrate Plus Migrate Tools and the D8 core migrate modules. It doesn't migrate ...
1
vote
1answer
370 views

Preprocess language switcher block

I'm trying to modify the output of the language switcher block to make the output more inline with other menu styles on my site. However, I can't figure out how to modify the output. I'm attempting ...
0
votes
1answer
382 views

How can I export a multistep webform from an environment to another one?

How can I export a multistep webform from an environment to another one in Drupal 8?
4
votes
2answers
2k views

Search results only for the current language

I have a site with 4 languages and am using the builtin search to look for content on the site. How is it possible to restrict the search results only to the currently selected language? I tried ...
0
votes
1answer
12 views

Translation server suggests translation with old date

in admin/config/regional/translate/settings page, i had Check for updates set to never and translation server to Drupal translation server and local files. i recently updated my site drupal version ...
-1
votes
1answer
40 views

What is the logic of create method in ContainerInterface class & its argument when being used and how its related to argument of the construct method?

<?php namespace Drupal\custom_changes\Plugin\Block; use Drupal\Core\Block\BlockBase; use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Plugin\ContainerFactoryPluginInterface; use Symfony\...
2
votes
2answers
516 views

System emails translation

I wanted to translate emails sent to users after signing up using different language than English. I know there is a way to translate the system emails from the account settings translate tab, so I ...