Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

0
votes
1answer
20 views

How to use the YML structure of routes to control access to Group Content

I am using the Group module and would like to leverage each Group's permissions in my module's yml files. I have a module.permissions.yml with something like tam_api.group_gid_members_uid: path: ...
1
vote
2answers
37 views

Creating a view with multiple latest content types

I am looking to create a view for my home page that displays the 3 last added items for 2 different content types (articles and news). Like 2 lists next to each other that also has the option to show ...
0
votes
1answer
42 views

How to put a link in my route title?

In my custom module amap, I have amap.routing.yml with (among others) this route: amap.distribution_inscription_many_form: path: '/amap/editPlanningMany' defaults: _form: '\Drupal\amap\Form\...
0
votes
0answers
28 views

Commands doen't work because of the Address module and its dependencies

When I try to use a Drupal Console command, even a simple a drupal list, I get an error. Fatal error: Class 'CommerceGuys\Addressing\AddressFormat\AddressFormatRepository' not found in /path/to/...
0
votes
1answer
24 views

Facet - default value with search api

I am using content type in Facet. The search result will be having an option to choose the content type to filter the result. I want the search should show the result with particular content-type ...
2
votes
1answer
71 views

Is there a “best practice” for overriding a contributed module's controller in Drupal 8?

I'm still relatively new to Drupal 8 and recently I came across an occasion to override the WebFormSubmissionListBuilder Controller. I eventually found another project which had exactly the same need ...
0
votes
1answer
103 views

Why can't I update core from 8.6.16 to 8.7.1?

I need to update my Drupal 8 site from 8.6.16 to 8.7.1, but when I run composer update drupal/core --with-dependencies it says "Nothing to install or update". I have been banging my head on the wall ...
0
votes
0answers
22 views

Check for cookie value(s) for a visitor and attempt to authenticate them?

I have a case where when a visitor comes to the site from a subsite (different application), if they are authenticated (there will be a cookie value), I need to get this cookie value and initiate a ...
0
votes
0answers
11 views

Is there a way to add custom fields before the “Add to cart” option with the “Basic Cart” plugin?

I'm using the Basic Cart plugin to create orders in Drupal 8, but I have a problem. Before I add some products to the cart, I have only the Quantity option which the default plugin option. Is there a ...
0
votes
1answer
29 views

Can't set arguments to a view for displaying all data

I use $view = views_embed_view('export_emargement','page_1',$journee,$region,$produit); it works well, but If I don't want to specify $region the view does'nt works. Im my view admin if I set ...
0
votes
1answer
38 views

REST login problem

I'm trying to log in to drupal8 via api rest using postman. POST: https://example.com/user/login?_format=json Content-type: application/json { "name": "admin", "pass": "password" } The problem is ...
0
votes
0answers
26 views

Get input label on input.html.twig file

I'm working on an input.html.twig file. I need the label name of the input for class and other reasons, but for some reason, I can't figure out how to grab it. I thought it would be part of the twig ...
0
votes
1answer
59 views

Drupal 8.7.0 chmod() and touch() operations not permitted

After updating drupal8 for 8.7.0 and then to 8.7.1 versions i have next errors: Warning: chmod(): Operation not permitted in Drupal\Component\PhpStorage\MTimeProtectedFastFileStorage->save() (line ...
-5
votes
1answer
39 views

Automatically redirect user depending on its device screen size?

In a custom module (amap), I have two forms with the same final purpose: handle (create, update, delete) a custom content entity (distribution_inscription). The first one (...
1
vote
2answers
30 views

How to get my custom module to recognized a exported view?

I have created a view and then exported it normally to a yml file. Then I put this yml file into my mycustommodule/config/install folder. So current its named mycustommodule.view.user_assigned.yml ...
0
votes
1answer
28 views

Not able to enable 'Configuration Translation' module gives error

I am trying to enable MULTILINGUAL -> Configuration Translation. It gives below error. Error: Call to a member function getPath() on null in Drupal\config_translation\ConfigNamesMapper->...
1
vote
1answer
10 views

Configuring Fail2ban for the r4032login module

Recently, I installed fail2ban on my server to help prevent bots from abusing the site. I have the r4032login module installed and it is writing to the log, but it is using HTTP status 302 for the ...
0
votes
2answers
127 views

How do I prevent anonymous sessions?

I'm working on a site hosted on Acquia and we're using Varnish and Akamai. We don't want anonymous sessions from being saved in the db, as it breaks the caching. I've made a few tweaks, and I'm ...
0
votes
0answers
13 views

Taxonomy terms not localized in view with enabled aggregation

On a view on content, I added a field "All taxonomy terms" (Display all taxonomy terms associated with a node from specified vocabularies) and enabled aggregation, see screenshot of view attached. ...
0
votes
0answers
28 views

Doing a checkout via API?

I am trying to figure out if it is possible to do a checkout via API for Drupal commerce 2. In Drupal 7 there was a module Commerce Services Resources. I found some posts, but they don't answer my ...
0
votes
0answers
25 views

Send shipment tracking number to customer

Drupal commerce 2.x Seems all shipment tracking number modules are for drupal 7. How can I enter and send a tracking number to the customer when order is marked as fulfilled in the commerce ...
0
votes
0answers
37 views

How to get translated term name from TID in views field template?

For a complex view, I need to alter the output of a localized term field: instead of putting out the TID of the term, I would like to render the localized term name. Does someone know how to alter the ...
0
votes
1answer
14 views

Stale Pathauto Alias

I'm just curious how other Drupal developers handle nested path aliases when they are based on another page's url pattern. I have a product landing page (it's a "basic page" node). When it's created,...
0
votes
0answers
24 views

Errors while updating core to latest version

I have a website I had worked on but never finished, last year. It is at version 8.5.4. I've imported it (from a devdesktop environment) into a Docker/Docksal environment. At this point I can see a ...
0
votes
0answers
23 views

How do I programmatically get the flag creation time?

I need to get the creation time for a flag on a node. I started with the following code, but I probably need to use getEntityFlaggings() passing the node and the flag ID. $flag_service = \Drupal::...
0
votes
1answer
39 views

How do I a custom entity operation with a webform submission?

My lack of D8 experience is going to show by just how many unknowns I have here. I hope someone can link some of the pieces for me. I created a custom action using hook_entity_operation_alter() on ...
0
votes
0answers
44 views

How can I avoid getting “This route can only be accessed by anonymous users”?

I'm trying to use REST login from a React native app. When the user tries to log in, the app calls: var data_node = {name:this.state.username,pass:this.state.password}; axios.post('http://IP/user/...
0
votes
0answers
29 views

Replacing a specific content creation with the newest version

I'm creating a website that tracks users weight. A user can create content to enter their weight and I have a view that displays all entries of a users weight however I want it so that if a user makes ...
0
votes
1answer
46 views

'image_style' entity with ID 'media_library' already exists

Recently updated Drupal to 8.7.1 and I am seeing the following error when running database update: www-data@php.container:/var/www/html/web $ drush updb -y The following updates are pending: ...
1
vote
2answers
70 views

How to call a function in a form from another form? [closed]

I have 2 forms: distribution_inscription_table_form and distribution_inscription_for_user_form in the same custom module (amap). namespace Drupal\amap\Form; use Drupal\Core\Form\FormBase; use ...
0
votes
0answers
14 views

How do I use the DateFormatter? [duplicate]

I am trying to use the DateFormatter so I can convert my unix time-stamp into a usuable date stamp that will be set on a custom form. This is my code: $time = \Drupal::time()->...
0
votes
0answers
48 views

Loop Paragraph types with all values in field--field-page-detail-paragraph.html.twig

I have two paragraph types called First Type & Second Type and added Image & Text fields on it separately. I have created the basic page & added the two above paragraphs(First Type & ...
1
vote
2answers
43 views

Can I remove the experimental module warning from /admin/reports/status?

My drupal 8 site is showing a experimental modules enabled warning under /admin/reports/status. I vaguely remember to have them enabled at a certain time, but I forgot where. I don't use any of them, ...
1
vote
1answer
35 views

How to correctly format a POST request to the file_upload Rest Response?

This is my first time posting a StackExchange question, so thanks in advance for your patience. We are attempting to upload an image to a headless Drupal application using the File Upload REST ...
1
vote
0answers
44 views

Managing custom themes and modules using composer or git

If I am managing my drupal 8 site using the Composer workflow, how should I go about incorporating/managing custom themes and modules? Let's say I have a custom theme that I manage using gitlab. Do ...
0
votes
0answers
26 views

How can I configure half dollar amounts to be displayed as $n.50 while whole dollar amounts display as $n?

In drupal commerce, I have a product variation type with a price. In the 'manage display' area, in the 'format' section I have 'strip trailing zeroes' selected. My prices are all either whole dollar ...
0
votes
0answers
17 views

Using Layout Builder With Menu Items

I recently just updated to 8.7 and for the most part everything is working well. In my dev environment I was working on a new feature using layout builder with menu_item_extras to apply a layout to ...
0
votes
0answers
14 views

Options for bulk publish/unpublish of content

I'm trying to see if there are any options (contrib modules) for an admin action (/admin/content) to bulk publish/unpublish like some of the other options listed? Basically, I'm looking for: the ...
1
vote
1answer
19 views

Refreshing entity definition

I've got a D8 media type that holds information obtained from an external source. The information comes in name value pairs that I wish to save as individual fields, mostly so I can index them easily ...
0
votes
0answers
25 views

Running a site with a reverse proxy and subpath

I'd like to run a Drupal 8 site from behind a CDN as a subpath. What that looks like is: Canonical D8 install: somedrupalsite.companyname.com CDN edge domain: www.example.com D8 accessible at: www....
0
votes
0answers
20 views

D8 EntityQuery condition: entity reference field is empty [duplicate]

I need to get (programmatically, using entityQuery) all the nodes of type "contact" where the entity reference field "field_associazione_contatto" is empty (it is not a mandatory field). I've tried ...
0
votes
1answer
57 views

Clearing cache takes “long time”

I am absolutely new in Drupal. I am trying to set up my first "Hello world" module and I am playing with it. Every time I clear cache using Drupal Console, it takes 15 seconds, which is an eternity ...
0
votes
2answers
29 views

Search Nodes by reference field target ID

I have a Node by the Project bundle name. Each Project has a reference field to another entity by the name of Contact, that this contact entity has the Client bundle. I can get the Client target ID ...
2
votes
1answer
30 views

Calling a JS function after managed file has completed uploading

How can I call a JavaScript function after a file has completed uploading using the Drupal Form API (FAPI) managed_file element?
0
votes
1answer
65 views

How to upgrade to Drupals latest version via Composer?

Currently I have 8.6.13 installed. composer update drupal/core --with-dependencies Package "drupal/core" listed for update is not installed. Ignoring. Loading composer repositories with package ...
0
votes
1answer
25 views

How to get text from radio option value

How do I get the option text from the submitted value of the radio field in Drupal 8 webform submission? I have written a rule action condition on webform submission where I am storing data in a ...
0
votes
0answers
16 views

Filter content moderation view according to user roles that I currently login to the site

The view I try to filter is only accessible to authenticated users and they have defined roles, that is, it is an administration view. I have several types of content and I want to show in the ...
0
votes
1answer
43 views

Set and Get $form_state with ajax button submit function?

In my case, I need to get a list of config files to show in a form element. Extending from this Drupal Answers Q/A using form_state->set() inside ajax callback but cannot get the value back outside ...
0
votes
1answer
36 views

Adding a custom data-attribute to a field in Views

In a view I need to add a custom data-attribute to the row output (just like classes are added). Simply rewriting the output doesn't work because XSS attribute filtering strips the attribute. How can ...
0
votes
0answers
20 views

I accidentally deleted basic_cart_vat, there's a way to a restore this field?

I accidentally deleted the field basic_cart_vat from Orders, now I'm receiving an error because I don't have the field. InvalidArgumentException: Field basic_cart_vat is unknown. in Drupal\Core\...