Questions tagged [8]

Version tags should be used 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
22 views

How to get the base URL of a site in Queue API?

I am trying to get the base url of the drupal 8 website in a queue process but I am getting http://default as the base url. What am I missing here? public function testUrl() { global $base_url; ...
-1
votes
1answer
25 views

Webform 6.1.0 help text not showing

I updated my webform Module from 5.3.0 to 6.1.0, I have one the Following Error: the help text isn't displaying its content on any form on my site (Example of help icon in the shared image) It should ...
0
votes
0answers
29 views

View injecting weird html elements (b element)

I've noticed recently that, in a drupal website I'm maintaining, a view displaying a list of content type called Event, has some weird html elements injected. This messed up the layout and I'm not ...
0
votes
0answers
18 views

Node Access based on User reference field on node

Unable to find a good place to start in Drupal 9 for addressing this issue. I have a content type that is used for temporary access. The node is created and has an expiration date. The node is deleted ...
0
votes
1answer
32 views

Allow user to control access to own content for other authenticated users

I just want a field in a content type, so that when a user creates new content he/she can select whether that content can be viewed by other authenticated users or not. I prefer doing this with a ...
0
votes
1answer
31 views

SQL Error when trying to remove content type field

I was trying to create a new Content Type for my site and I chose a field name ("description") that already used for other content types. The problem occurred when saving changes as the ...
0
votes
0answers
34 views

Webform update from 5.3.0 to 6.1.0 results in directory error

After I updated my webform module from 5.3.0 to 6.1.0 I received an error when submitting my form. Apparently it isn't able to copy the pdf file which I added to the form and so it is blocking the ...
0
votes
1answer
188 views

Webform 5.3 to 6.1.0 , Error : Call to undefined method Drupal\webform\Routing\WebformUncacheableResponse::addCacheableDependency() [closed]

I updated the webform module from 5.3.0 to the latest version (6.1.0) and then when I click submit on one of my forms, I receive this ERROR: Error: Call to undefined method Drupal\webform\Routing\...
0
votes
1answer
33 views

Similar content with contextual filter by url [duplicate]

There are two types of content (as an example): fruits vegetables They share the same vocabulary and similar terms. Catalog structure: -Fruits --juices ---for children ---for men ---for women -...
0
votes
0answers
53 views

Split taxonomy terms in two facet filters

English is not my first language, so please be patient. I'd like to ask for assistance to split my taxonomy terms in two facet filters. Context: Drupal Core v9.2.6 Acquia Search v3.0.5 Acquia ...
0
votes
1answer
29 views

Experiencing problems filtering view programmatically

I'm using a views block in my website, the content of this view is filtered programmatically. I now get messages from users who see the wrong information. The filter is based on the currently logged ...
-1
votes
1answer
48 views

How do I access the protected value of node entity?

I have a view node and I use the below code to Kint out the node objects: $node = \Drupal::entityTypeManager() ->getStorage('node') ->loadMultiple(); dpm($node); returns the below ...
0
votes
0answers
50 views

Alter route path within event_subscriber with GET parameters

I know I can alter route path with event_subscriber class AdminRouteModifier extends RouteSubscriberBase { protected function alterRoutes(RouteCollection $collection) { if ($route = $collection-...
0
votes
0answers
19 views

Read reverse-relationship from a view programatically

Alright, this is taking so much time than expected. I'm having a comment type "Default comment". The comments under this comment type is published and created as nodes under "level3&...
0
votes
1answer
18 views

Read entity reference node field

I have a referenced entity named - field_cp_level2_ref_level3. This field belongs to level3 content type. when I dump the $entity, I see the field as below: entity:node:level3::...
1
vote
1answer
32 views

How to display an SVG code in a Views?

​ I added the following code for a "Global: Custom Text" field of a Views : <div class="messages-list__item messages messages--warning" data-drupal-selector="messages" ...
0
votes
1answer
25 views

How to change the condition to AND in accessing content by role in a view-block?

I have a view-block 'Expo', I want to display this block only if current user has two specific user roles i.e., 'Actor' and 'Singer'. When I checked the both 'Actor' and 'Singer' , The block is ...
0
votes
1answer
59 views

Use ajax to save modal / dialog form instead of page reload

I'm looking for a way to save modal & dialog forms through ajax instead of redirecting the user after the form submit. Ajax is quite unknown territory to me. I've found several interesting topics ...
0
votes
1answer
43 views

Anonymous user redirected to core/install.php while admin does not

As an admin I've built a large table on Drupal 8 (php, mysql). It runs without issues for Admin, but trying as Anonymous user it redirects me to core/install.php Since it's ONLY affecting Anonymous ...
0
votes
0answers
25 views

Show view filters dynamically with AJAX

The structure is following: A product content type, with 2 taxonomy reference fields (Category and Origin country). A view that shows products. Is it possible to show 2 buttons for the Category and ...
0
votes
1answer
20 views

Multi-lingual Webform, not entire website

Our client does not need their entire website to be translated into multiple languages. However, they have a webform that provides a number of different languages in a dropdown, and would like the ...
0
votes
0answers
25 views

Why my custom select view filter is not working?

I have a publication content type, each publication can have one or more authors. I'm trying to add a custom select list filter depending on the author, so far i managed to make it appear in the view ...
2
votes
1answer
68 views

Drush script memory problem

I'm running a long drush script and its causing memory problems. Then I tried debbuging it and I have this very simple code: $query = \Drupal::entityTypeManager()->getStorage('user'); foreach ($...
0
votes
0answers
19 views

Email notification when new content is created

We have been using email notifications in workflow, but now it is not sending mail from creation to next state. We have setup a notification from "any state" to our next state "draft&...
1
vote
0answers
30 views

How should I reroll a merge request that has merge conflicts for a contrib module issue?

I am trying to reroll a branch called "3226640-link-for-all" for a contrib issue. Note: The intial merge request was created by another user. I am trying to reroll it and maintain the credit ...
0
votes
1answer
57 views

How to create a breadcrumb trail with the taxonomy terms used by the node?

My website works with Drupal 9, I created a taxonomy for my nodes : I installed the following module : https://www.drupal.org/project/easy_breadcrumb Here is what I am trying to do. If my "node&...
0
votes
1answer
31 views

How to use custom HTML code for a front page

I want to use custom HTML code for a front page in drupal 8 but I am a bit lost of how to do it. Is it possible to just insert a piece of HTML code in a basic page content? Or what is the best way to ...
0
votes
0answers
18 views

Overwrite/hook VBO action processed message

Googled so much for this and didn't find a way. I am using VBO to perform custom actions in my view. When a selected action has an error, I print the message using: \Drupal::messenger()->addWarning(...
0
votes
1answer
38 views

How to edit file 'description' label and help text

I want to edit the file upload description label and the help sentence underneath it: I tried the below code: function mymodule_field_widget_form_alter(&$element, FormStateInterface &$...
2
votes
0answers
29 views

Grab State variable value from View grid - Drupal 9

I have a drupal view that has a multiselect field at the top. Based on the grid row selection and multiselect field value, specific actions are carried out on the grid rows. It's all based out of VBO ...
0
votes
1answer
103 views

How to override a class method that is not a service?

Usually we override services using RouteSubscribers, but i need to override a method of a class that is not a service. I need to alter the module of the core "views", the general structure ...
0
votes
1answer
49 views

substitute for \Drupal\file\Entity\File::load($fid) in Drupal 8.9

My goal is to load a file and get its properties. The method 'Load' does not exist any more in Drupal 8.9 (in the File.php file) \Drupal\file\Entity\File::load($fid); What would be the substitute for ...
0
votes
1answer
26 views

Pager element not showing on form

I have a simple tableselect element inside my form and the tableselect rows are populated using a pager as follows: $pagerLimit = 10; //default value if nothing is passed in $query = $this->...
0
votes
1answer
42 views

Check minimum checked Checkboxes

i am new to the drupal world. I have created a web form, there are several checkboxes there. like: [1] [2] [3] [4] I would like to check whether at least X of the checkboxes are selected before ...
0
votes
0answers
23 views

Style.css not workign in a classy subtheme

I created a subtheme based on classy with this .info file: name: youverify_theme type: theme description: This is a sub theme of Classy core: 8.x core_version_requirement: ^8 || ^9 # Defines the base ...
0
votes
0answers
23 views

Caching related to submit functions and Varnish

I am trying to set my website ready before installing and configuring Varnish on it. For that, in lots of cases where I have php functions in .module files that include some tests about cookies if ($...
1
vote
0answers
22 views

Display WYSIWYG editor group names to endusers modifying content

When one is editing the Toolbar Configuration in a Text Format in Drupal 8, group names can be added to the editor as part of grouping the buttons in the toolbar. Is it possible to expose those group ...
0
votes
0answers
20 views

Drupal hubspot forms with Varnish

I have a Drupal 8 hubspot form built in a custom module which holds many fields among which a "Favorite Pizza" field coming from hubspot and this field is rendered as a required fieldset. ...
0
votes
0answers
14 views

How to assign css class to an image in CKEditor

I migrated a site from Drupal 7 to 8. In Drupal 7, there was the Image2 module, which isn't available in Drupal 8. I inserted an image in a block I created and assigned the CSS classes to the block. ...
1
vote
2answers
37 views

What's the equivalent of drupal_build_css_cache()?

Our client uses an external website for some of their pages. This provider does not enable us to theme their website directly, but they do allow us to load a single JS file from the Drupal site that ...
2
votes
1answer
28 views

Why can't some fields be moved within details element?

I am trying to move 2 form fields to the advanced sidebar: dismissible and status. Status was already part of the meta container and setting #group='meta' on dismissable also placed it there; but ...
0
votes
1answer
34 views

How do I programmatically set a content reference by name for a node?

Hi team i have some isssues. I'm creating a node and i would like to set a content reference by name not by id, i'm doing this but this is not working: 'field_content_type_items' is referenced to ...
1
vote
2answers
83 views

How to use migrate process plugin concat on multiple values?

I am trying to import from a csv that has multiple files in the same column, e.g. title,gallery,tag node1,img1.jpg|img2.jpg|img3.jpg,2 node2,img4.jpg,2 node3,img5.jpg|img6.jpg,3 I need to prepend the ...
1
vote
1answer
46 views

How to import a custom content type in phpunit

I'm trying to write some PHPUnit Kernel tests that use a custom content type which seem to work until I try to reference fields on the content type. I'm guessing the content type isn't being imported ...
0
votes
0answers
18 views

Breakpoints in custom theme not showing in the "group breakpoints" field

I'm having a problem that i simply can't find how to resolve it. I've created a custom theme based on the "claro" from drupal core. Then I've installed the modules Breakpoints + Responsive ...
-2
votes
1answer
26 views

View Filters' OR operator not applied

I created a content view that has a filter group using the AND operator that is ANDed with another filter group using the OR operator (see image below) However, the query constructed is all AND ...
0
votes
0answers
25 views

How can we directly display/download attached document on Media path

I am trying to directly display/download the attached file when the Media link is reached. Main reason behind this is to avoid providing file path directly. For example: if a user is visiting www....
0
votes
0answers
32 views

How can I get specific fields from user object in the REST API?

I have a question about retrieving fields from the user object using REST in Drupal 8. When i am logged in into Drupal i can use the following GET call too retrieve the user object: http://localhost:...
0
votes
1answer
38 views

How to retrieve #tree values inside a multiple containers?

I am using Drupal 8 and I am creating multiple forms that are made of a #tree hierarchy. I am retrieving the value of the "first name" from the #tree using the below code and it doesn't get ...
1
vote
2answers
92 views

Injecting a NEW instance of a service into another service class

I have a service (for sending error alerts) which is used by multiple other services. The alert service is injected into those classes via the relevant services.yml files and through their ...