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
-1
votes
1answer
48 views

How can I collect a shipping address on the checkout flow?

I am using the Commerce PayPal module. PayPal is collecting the billing address, but I need to collect the shipping address on checkout. How can I collect the address? Do I add an address field to ...
0
votes
1answer
30 views

Unknown drupal_view() function although Twig Tweak is installed

Acquia BLT won't let me commit some Twig. > tests:twig:lint:all Validating twig syntax for all custom modules and themes... Iterating over fileset files.twig... ERROR in ~/repos/agency/client-...
1
vote
0answers
32 views

Order minimum quantities

I need to set order minimum quantities in my Commerce 2 website. The website has two stores: retail and wholesale. Customers who are shopping in my "retail consumers" store must have at ...
0
votes
1answer
16 views

Private file path getting set as public local files

I have a new Drupal 8 site up and running, and in the File System settings I have the Default download method set to Public local files served by the web server. My public folder is set to site/...
0
votes
1answer
14 views

Import images after git clone

So I did a git clone to get my Drupal 8 site working locally on another PC. This project already has a lot of nodes (articles) with images attached to them. The site works perfect, but of course I did ...
0
votes
1answer
12 views

Salesforce Connection

I am currently getting an error when trying to connect Drupal 8 with Salesforce. This will be the first time I am hooking into Salesforce from Drupal and I am not entirely sure what I am doing wrong. ...
0
votes
2answers
30 views

Map array of node IDs to bundle types without loading all the nodes

For complicated reasons I need to map an array of node IDs to a list of node bundles. That is, for a given list of node IDs, I need to get all the different bundles (node types) of the nodes the IDs ...
0
votes
2answers
43 views

How to programmatically associate a taxonomy term to a field

I'm trying to import user profiles data from a JSON file. Several fields are entity reference to vocabularies. I'm able to create a new taxonomy term entity in the universities vocabulary bundle ...
1
vote
1answer
19 views

Views relationships

I have a content type called part with a multivalue reference field to a custom entity called fitment. on the part there is a field called SKU and on the custom entity type fitment there is a field ...
0
votes
0answers
15 views

Drush failing to load drush.php file

I have Drupal 8 project on my local machine, which is set up with composer and I got drush included. When I'm in project root I can call drush like: vendor/bin/drush -v And that work well (...
0
votes
1answer
61 views

What payment gateway should be used for invoice payment?

My Drupal commerce site supports multiple payment gateways. One of the payment types should be paying by invoice. That means if you select invoice payment type during checkout process you don't have ...
1
vote
0answers
40 views

Is it safe to truncate the key_value_expire table?

I am seeing over 8 GB in the database for the key_value_expire table. Is it safe to manually truncate that table? This appears to be caused by a bug in the Honeypot Module, which I am unable to ...
0
votes
0answers
19 views

correct syntax for feeding lat/long to geofield_latlon in migration

I have a drupal 6 site I wish to migrate to drupal 8. My configuration includes: migrate_plus.migration.upgrade_d6_node_complete_club.yml # ... class: Drupal\node\Plugin\migrate\D6NodeTranslation ...
1
vote
1answer
57 views

What is the difference between State API vs UserData API?

In which case we will use State API ? Instead of UserData API ? Some Use cases where we will use State API ? Some use cases where we will UserData API? Is there any difference apart from the ...
0
votes
0answers
12 views

Show a field on a taxonomy term in views

I have a view that's showing a custom entity type. Each of these entities is categorized with taxonomy term. Terms in this vocabulary have a field on them that I need to pull in to my view. Currently, ...
0
votes
1answer
19 views

Get the user ID for a newly created user account

I'm trying to import user data from a JSON file. So far I've managed to import user entities with some fields. The next step would be to retrieve the user ID. The code I wrote is the following one. $...
0
votes
0answers
18 views

Create URL encoded taxonomy term name in views field

I have a view of taxonomy terms where I need to overwrite the output of a couple fields to be Solr search URLs, and part of the URL is the url encoded term name. So, for instance, if my term name is ...
0
votes
1answer
29 views

Access denied when trying to import single configuration item

I am using Drupal 8.9.2 and trying to import a view using the Configuration Management UI in the admin. I did this with no issue importing the view from my local dev environment to our dev server, but ...
0
votes
0answers
13 views

Theme custom page template file shows `page not found` but still displays correct content

I have a page--home.html.twig file in my Barrio Subtheme, and when I navigate to mysite.com/home the content is shown but the title shows page not found and in the recent logs I have an error: page ...
0
votes
0answers
29 views

Front Page displays on user/login

I recently created a new front page template page--front.html.twig in my theme, and then changed my front page to mysite.com. When I did this, it removed my login page, now /user/login only shows my ...
0
votes
1answer
81 views

Failed updating from 8.8.8 to 8.9.2

I want to update my Drupal website from 8.8.8 to 8.9.2. I have separately tried each of the below: Run composer update Removing both Vendor directory and composer.lock file then run composer install ...
0
votes
0answers
44 views

How save and get cookies after wrbform form submit

In Drupal 8, Create a form using webform. Display form by using block on every page. I want to save cookies after webform form submit. By using hook_form_alter(), and user_cookie_save(['xyz' => '...
0
votes
0answers
10 views

How can I change the date format in the webform submission section?

I know this is a simple question. The rest of the date fields on the site match the right format dd/mm/year. However, the dates in the submission info section of webforms are in a different format. ...
0
votes
1answer
16 views

How to access backbone model from custom javascript outside of view

I was wondering if there is a way to access backbone model variable outside the scope of the backbone model/view.This is the backbone model: function (Backbone, Drupal) { Drupal.addToCart....
0
votes
1answer
23 views

User Role creation in module overridden by configuration import

I'm creating a user Role in a .yml file like user.role.myrole.yml. This works fine when this module is installed manually and the Role is created. When I enable this module via configuration import ...
1
vote
0answers
9 views

How to add translation of terms to a search API index?

I have some media in the site default language, it is tagged by terms and the terms are translated. The media is not. How could I add the translated terms to the search index so it's possible to find ...
0
votes
1answer
17 views

Using Less in Barrio Subtheme

I am attempting to use Less in my Barrio sub theme on my Drupal 8 instance, but am running into some issues with it actually loading onto my page. Right now, I have three less files: variables.less ...
-1
votes
2answers
23 views

Looking for a solution to add taxonomy after user submitted a node?

I want users to be able to publish content without having to associate it with a specific taxonomy term. They only have access to taxonomy tags. I would like to be able to assign content to categories ...
0
votes
1answer
12 views

Unable to specify different grid columns settings for page and attachment

I am trying to build a views grid display where I have two rows of 3 items each, and then one row of of four items. To me, the logical approach would be to use a primary display in a grid format, and ...
1
vote
2answers
38 views

Proper way to alter field value from submit handler

I added extra field "field_password_changed" to user account and I want to store there time of latest password change (simple input field). Now, I added custom submit handler to catch user ...
0
votes
1answer
99 views

Cannot get currentUser after custom Drupal boot

I have a /foo.php on the Drupal 8 root which programmatically boots Drupal: chdir('web'); $autoloader = require_once 'autoload.php'; $request = Request::createFromGlobals(); print_r($request->...
0
votes
0answers
5 views

Custom view filter integer condition in string format [duplicate]

I have added a new custom view filter with next code: /** * Filter . * * @ingroup views_filter_handlers * * @ViewsFilter("filter_pricelist") */ class PriceListFilter extends ...
0
votes
1answer
17 views

How can I add a contextual filter with taxonomy term name as entity reference?

I have a content type "award" which have a taxonomy (product) as entity reference. I want to add a contextual filter by term name on my view. I tried to use a contextual filter on "...
-2
votes
2answers
33 views

How to load my module's css file after my theme's css file?

In my theme, I have css files loaded through mytheme.libraries.yml and mytheme.info.yml file. In my module I have added a css file like this function mymodule_page_attachments(array &$attachments)...
0
votes
0answers
14 views

How do I remove an option from a select list if it's already been used in a submission in the past?

We're trying to create a select list as a part of a webform but we want to remove an option from the select list if it has already been chosen. An example of this list is for Chart of Accounts against ...
1
vote
0answers
38 views

Why is the output from getDefinition($type) different from getStorage($type)->getEntityType()?

In a Controller, when calling: $this->entityTypeManager()->getStorage($type)->getEntityType(), I do not have the exact same return value as: $this->entityTypeManager()->getDefinition($...
0
votes
1answer
14 views

Create language locales in D8

I am attempting to create/enable the UI to allow users to create translations in D8, and I need to create locales (e.g. en-us, en-gb, en-ca for English, es-mx, es-es for Spanish, etc). I've gone ...
0
votes
1answer
44 views

Tracking how long it takes a user to submit a node edit form?

For a quiz node, I want to track how long it takes a user to submit a node form (the time from Drupal generating the form until the time that the user presses submit), and I want to store this ...
-1
votes
1answer
27 views

Checking whether an arbitrary field is valid for user entity

In my module I have a form where I want to give an admin the ability to configure which user field they want to put certain data in. In the context of the admin form, I'd like to verify that the field ...
1
vote
1answer
44 views

How can I programmatically get a checkbox value?

I need to check if "Close this ticket after replying" checkbox is checked or not. The value $ab is not getting displayed. This is a comment type created from Structure > Comment Type. ...
0
votes
0answers
27 views

Change storage path of file element

My webform allows file uploads, but I want to save them in a specific folder within the private folder (private://form_name/submission_id/original_file_name.ext). How do I do this? I see the Rename ...
0
votes
1answer
24 views

Views filter that alternates content types?

Does anyone know if it's possible to have a view that alternates between content types? Aka show 1 of content type news and then 1 of content type article repeating?
0
votes
3answers
54 views

How can I delete a poorly named vocabulary?

I've created a couple of vocabularies programmatically, and accidentally included some spaces in the machine names (caused by bad data in an input CSV). I can't delete these vocabularies with ...
-2
votes
0answers
43 views

Route “entity.webform_ui.element.add_page” does not exist [closed]

Symfony\Component\Routing\Exception\RouteNotFoundException: Route "entity.webform_ui.element.add_page" does not exist. in Drupal\Core\Routing\RouteProvider->getRouteByName() (line 201 of /...
0
votes
2answers
62 views

Is there a cli equivalent of the web ui with underspecification?

background I run drush cget markdown.settings and see: dependencies: module: - markdown parser: id: michelf/php-markdown-extra render_strategy: type: none settings: ...
0
votes
1answer
50 views

How to get pathInfo in twig? [duplicate]

I want get the pathInof in my template twig : How i can reach pathInfo please in my template ?
0
votes
1answer
30 views

How can I reset render cache on an entity for current user in hook_entity_view_alter()?

I have Commerce products for which I'm showing or hiding the add-to-cart link, if that product is or isn't in the current cart. In my code: function mymodule_commerce_product_view_alter(array &$...
1
vote
1answer
35 views

Adding fields to content type edit form (not to the node itself)

In Drupal 8, how do you add fields to the content type edit form, i.e. where you define the content type? I know how to add fields to the content type that wind up on the node edit form, but I'm ...
1
vote
1answer
65 views

Drupal 8 CKEeditor license/pricing

Drupal 8 ships with ckeditor as the default text editor. Drupal itself can be used free of charge without limitations. At least this is what I thought until now. While CKEditor seems to be OpenSource, ...
0
votes
0answers
34 views

Drupal 8 custom theme, twig and template

I want to display all authenticaed users in a custom template with a custom twig file. All works fine, except that the twig file is not recognized or loaded. My module name is "ThemeLoader" ...