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
37 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
34 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 ...
-2
votes
0answers
22 views

Migration source plugin - authentication failed

I'm trying to make a source plugin for importing from mongodb. My plugin class is defined here: class MongoDBSource extends SourcePluginBase implements ConfigurableInterface { and inside the ...
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 ...
-1
votes
0answers
28 views

How to override webform contibute module with custom form in drupal 8?

I am new to drupal, so presenting my scenario: We have a requirement to create a page with a form. To do so I have implemented it inside the system/page--campaign.html.twig and pass the form from ...
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
63 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
28 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
55 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
17 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
37 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
27 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
78 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
44 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
24 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
35 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
20 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
20 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
19 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
26 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
33 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
46 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
30 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
17 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
23 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
23 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
28 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
91 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 ...
2
votes
1answer
66 views

How to return an XLS file to download on form submit

I am trying to create an XLS file and send it to the browser on a form submit but I cannot figure out how to do it. I am using XLS Serialization module but I'm open to all other suggestions. With this ...
0
votes
2answers
35 views

How to retrieve #tree values inside a form?

I am new at Drupal 8 and I am creating a module that has a #tree form. I chose #tree form to create multiple forms which has the same textfields and button. I came across one document in drupal about #...
-1
votes
1answer
21 views

How do I list all users in a view that have created a node with certain taxonomy terms?

The goal is to create a view to list users on a page with url /search/[category]/[topic]/[location] where "category" "topic" and "location" are taxonomy fields in nodes ...
0
votes
0answers
48 views

Varnish and custom blocks

I want to configure varnish on my drupal 8 multilingual website and I have a block that appears on a page whose path is /my-test . So in french the url would be like this : /fr/my-test whereas in ...
0
votes
1answer
52 views

How to keep similar custom services from conflicting?

I have two modules, each of which is defining a normalizer service module_one.services.yml services: module_one.normalizer.node_entity: class: Drupal\module_one\Normalizer\...
-1
votes
1answer
40 views

admin/reports/updates page not found

On a Drupal 8 project, the admin/reports/updates is not accessible. It just returns a 404 error without any issue.
0
votes
0answers
24 views

Testing an internal Drupal API that requires POST

I want to add a test around an internal API in Drupal 8 that only accepts a POST payload and fires off some services. I am getting the following: "curl error 3" From Guzzle when trying: $...
0
votes
2answers
50 views

What's the best way to migrate from manual upgrades to composer updates?

I have an 8.9.19 installation that I would like to move over to use composer. What's the best way to migrate the installation to use composer upgrades? Manual installations are becoming a real pain.
0
votes
1answer
30 views

Auto create a feed when a node is added

I am looking for a way to automatically add a feed (of a specific feed type), whenever a node is added (for a specific content type) using the node fields to auto-create the feed. I have searched this ...
1
vote
0answers
39 views

How do I override /libraries/ckeditor-wordcount-plugin/lang/some.js?

I'm using ckwordcount module which basically adds nice max length and counter features to text Fields, and relies on WordCount Plugin for CKEditor Editor. Most of the translations in the plugin lang ...
1
vote
0answers
28 views

Register form block into modal

I want to display the register form in a modal. For that, I created a custom plugin block which returns the rendering of the form register. /** * {@inheritdoc} */ public function build() { $...
0
votes
1answer
35 views

How do I get the entity ID from a view row and pass it along to the item list template?

I have a view which returns rows of entities. Each entity has several multi-value fields. The structure is kinda like this: Field 1: Item A Item B Item C ... Item H Field 2: Item A Item B Item C ...
2
votes
0answers
42 views

Is there a way to restrict time zone options in the DateTimeRange field widget?

Is there a way to limit the options of the timezone field in the datetime or datetime range widget in Drupal 8? It currently shows tons of timezones, but we really only need about 10 options. I ...
0
votes
0answers
5 views

Populate a node form field's select options from a view output (values only)

I'm looking to populate a node form field's select options (not sure the type of field to use) with values from a view output? I know Entity Reference field has that option... but it forces you to ...
0
votes
2answers
47 views

Change langcode

How can I change the entire site <html lang="en"> to <html lang="en-US">? I couldn't find anything on the Internet.