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
56 views

Adding a variable to a menu twig template

Im trying to use bootstrap for an accordion menu. My issue is that I need unique ID's for each accordion item. I found some similar topics here: Add Unique ID to Menu Item and here: How to add a ...
0
votes
0answers
16 views

What is the difference between index all on a node and indexing that takes place after node save for a rendered html node on a solr index?

If a page containing panels is indexed as a rendered item, when indexing all the content of the panels is not included in the index. However if you save the node then the content of the panels is ...
0
votes
1answer
38 views

How do I set the height and width for images that use a responsive images style?

When using the core Image module, the height and width of images are automatically set. But when I use the Responsive Images module and a Responsive Image style, then no height or width is set. Users ...
0
votes
0answers
30 views

How to disable form.js for the add comment form?

I have a node content type with comments enabled, and the "Add comment" form is configured to be displayed on each node page. Embedding the add comment form causes JQuery and all its ...
2
votes
0answers
24 views

Writing a custom migrate process plugin for multiple entity_lookups matching the same entity

I'm working on a migration of Album nodes, and before importing a given row, I'd like to do an entity_lookup that checks if there exists an Album node that has both a matching title and artist (...
1
vote
0answers
32 views

Assign a task to a user

I have a batch function that is called when the user has submitted the webform. Is there a function where I can assign the task to a specific user or role using a batch function? function ...
0
votes
0answers
25 views

I am hitting 150lb per package limit on UPS with Commerce Shipping on D8

I have a project that needs to get quotes (via UPS) of 4 50lb packages. I'm hitting the 150lb per "package" limit/error. Are there any solutions for changing the shipping request to UPS be ...
-1
votes
1answer
32 views

Export Node as Static HTML in a Zip

I have a content type called "Lesson". Lessons have fields like Title, Body, Image, Video, and Topic (term ref). I would like authors to be able to export any lesson they have created into a ...
-1
votes
1answer
16 views

Add “Add new content” custom block to a specific page

I would like to add a block which contain a button for when the user click would redirect to the Add new content page with a specific content type. I'm building some sort of a book store a would like ...
0
votes
1answer
32 views

How can I rebuild an image field with values in an Ajax callback?

in Drupal 8 I have media form with select box having ajax property and an image field. on select box value change I want to assign specific file to the image field. On form_alter this code work, the ...
1
vote
2answers
37 views

How can we make edit Body input area larger?

The Body field of the content on our website is generally quite large -- multiple pages. When Editing in Drupal 8, the Input Area is quite small -- 98 characters wide by 9 lines. The first thing we ...
1
vote
1answer
36 views

Inconsistent behavior with user_logout function

For a drupal 8 site, I have a custom function that does the following: It logs out the user and sends them to an external url Inside the controller CustomController, I have: function custom_logout(){ ...
0
votes
1answer
30 views

Custom Theme Repository update

I have a custom theme that I use in several websites. My theme is on gitlab. I can download my theme by composer in different websites. My problem is when I update repository theme with a fix or new ...
0
votes
0answers
23 views

Recurring order with multiple items?

I'm using Drupal Commerce with the Recurring module for subscriptions. Now when I create initial order with multiple recurring cart items for each recurring item separate recurring order is created. ...
0
votes
1answer
58 views

Check if empty region failed

I try to check if my sidebar second if empty. If it is not empty, I add a class col-md-8 on my section-main. To check if the sidebar is empty I use this code in the page.html.twig template of my ...
0
votes
0answers
18 views

Form element ajax callback errors not printed

Why are my validation errors are not printed when $form['content']['points'] triggers the ajax callback. Form errors are correctly printed if the submit button is pressed. <?php namespace Drupal\...
0
votes
0answers
12 views

Getting empty CookieJar when using cookie authentication with Python

I have a problem to acquire cookie through cookie authentication for RESTful in Drupal 8. In the beginning, I enabled the Basic Authentication module, but unfortunately, it does not work with my ...
0
votes
0answers
28 views

How do entity reference fields that reference the same entity avoid an endless chain of references?

We are using an multi-valued entity reference that references entities from the same Entity type. For example We have a Product Variation Type with an entity reference field on it, which references ...
0
votes
1answer
43 views

How to see all keys for a PrivateTempStore?

The Drupal class PrivateTempStore allows for setting and getting key-value pairs within a temporary data store. The class includes the $storage property which then has a getAll() method for retrieving ...
1
vote
1answer
52 views

How to create a message with message stack when user becomes a member of a group module group?

Hi currently I try to code a custom module for notification based on message stack module. Now I'm searching for the event or hook to perform some custom code when the user becomes a member of a group....
0
votes
2answers
29 views

Is it possible to change the Alt value inside the image.html.twig template?

Is it possible to change the alt value inside the image.html.twig template? I found out that it can be accessed via attributes.alt. And then there is a protected value. Is there a way to set it? ...
0
votes
0answers
15 views

Programmatically add multiple values to an entity reference field

I use the following code to load entities by their IDs. $themes = entity_load('theme',array(7,8,9)); $thid = array(); foreach ($themes as $theme) { $thid[] = $theme->id; } Next, I should add ...
0
votes
2answers
53 views

$form_state->set(), $form_state->setValue() doesn't save new value

Below you could find my code. It works fine until below the comment. I also tried countless combination of $form_state->saveValue(), but nothing works. Any ideas? function myforms_form_alter(&...
0
votes
1answer
38 views

Referencing CSS file from theme library inside Embedded Widget Paragraph type

I have an article page in Drupal 8 that contains a chart (inserted into the page using Text paragraph). The chart uses CSS classes that I have created inside the global stylesheet. It works, but I don'...
0
votes
1answer
36 views

How do I display a Media entity reference field in a nested paragraph on a template?

I have been working on this for 2 days and I can't figure it out. I hope someone can help me. I have a paragraph (dinamic_columns_grid) that has an entity reference field to another paragraph (...
0
votes
0answers
22 views

How “webform access group entities” block content take me to the webform results submissions page directly?

I installed the ' Webform Access ' Module on my website in order to control access to submissions by users with a certain role. I create a type of content called "Career" and a webform for ...
3
votes
1answer
94 views

How to use loadByProperties when one of the properties is an array?

I have this configuration entity and I want to load an entity using the properties label and subregions Lets say I want to load the entity if it has the label CU and the subregions CU-04. Note that ...
0
votes
1answer
16 views

Meta title doesn't show page title in panelizer

When I use Panelizer for one of my content types. My meta title tag doesn't include any of the node's page title. It's only displaying my Site name. So when I look at the tabs it just has my site name ...
0
votes
1answer
13 views

Views to show nodes filtered by referenced user

I am really confused about this. Tried with the Entity reference view but can not get the result working for me. It should be very easy to do it. I have a node called Book. Book has a field ...
0
votes
0answers
10 views

Webform Attach InvokeCommand to default ajax submit callback

I need to be able to do a call to the CRM upon form completion in the front-end/javascript. How can I add a command to be executed on submit of a webform without overriding the default behaviour? Is ...
1
vote
0answers
35 views

Filter nodes that have a field date that is not in the future

I have a view setup to list nodes that have "public date" date field that are in the past. To do that, the filter is doing a Content: Field Public Date <= today. "today" if the ...
0
votes
1answer
20 views

Promotions not translated on cart and checkout page? [closed]

I have commerce site in 2 languages: English (default) and German. I enabled translation of promotions so when I go to promotions admin page ( /admin/commerce/promotions ) for each promotion there is ...
0
votes
0answers
24 views

how to migrate multiple taxonomy terms?

I have a an array like this from json. [terms] => Array ( [0] => Array ( [id] => 1 [Name] => term 1 ) [1] => Array ( [id] => 2 ...
0
votes
1answer
25 views

How to migrate content from json?

I have a json file like this { "online": false, "key": "123", "Product": { "name": "product name", "Id": 12, }, } ...
1
vote
1answer
58 views

How to filter paragraphs by the field name on parent using entityQuery?

I have a paragraph type my_paragraph which is attached to a node type my_content_type on multiple fields like field_a, field_b, field_c, field_d. I want to load only those attached to some specific ...
-1
votes
1answer
24 views

How can I require customers to fill out a custom field when purchasing certain products?

I'm using the Commerce framework. I use the commerce_license and commerce_recurring modules to sell subscription memberships to users. I'm trying to implement gift memberships, so that User A (the &...
0
votes
1answer
20 views

How do I post JSON data on a remote resource?

I'm working to integrate a Drupal 8 site's content into a 3rd-party search tool. To get our data, the 3rd party requires us to post JSON to their API. Having never done this before, what is ...
0
votes
1answer
28 views

Hide region and make second and third region bigger

I created a custom layout for layout_builder that uses 3 regions/columns. IF my FIRST region has no content I want to make second and third regions width bigger. I tried to use an {% else %} statement ...
0
votes
1answer
36 views

Apache SOLR index or retrieve the node a file is attached to

I'm building a search engine with Apache SOLR (8.7.0) where PDF files are indexed and searched through, that part is working (with search_api_attachments in case you're wondering). However, the client ...
0
votes
1answer
32 views

How do I programmatically update the rendering language?

I am trying to programmatically set the Views rendering language of a couple of Views having multiple displays. I found that doing it manually is error prone. use Drupal\views\Views; $view = Views::...
0
votes
0answers
15 views

How to migrate update only recently updated nodes?

We have an organic group(OG) based blood bank application on Drupal 7 which is performing well. We are currently working for a D8 upgrade. We want to onboard two blood banks(OG) first on the new ...
0
votes
1answer
23 views

How to get a field value and multiply it to get price in a PriceResolver

Getting my feet wet with price resolvers, and I have figured out how to set a new price for all entities that have field_discount_percentage. I am then getting the price and multiplying it for the ...
0
votes
0answers
40 views

How can I display individual feed item images that are defined within an RSS feed (media:content tag) using Aggregator?

I'm fairly new to Drupal and as such would appreciate a bit of patience if I get lost in any in-depth explanations. :) Currently running Drupal 8.9.7. I've been trying to get the Aggregator module to ...
1
vote
1answer
19 views

Get list of preprocess block variables

How can I display a list of preprocess block variables so I can conditionally include a library? Using the 'plugin_id' doesn't seem to work and when I echo all of the variables all I see is a blank ...
0
votes
1answer
29 views

hook_init() equivalent for console command

I have a module which subscribes to the kernel.request event to set some environment variables for use with LDAP. E.g. setting the LDAP_CACERT environment variable. I'm using it to replace hook_init() ...
1
vote
0answers
10 views

Automatically select most expensive shipping rate

In my Drupal 8 Commerce site I have two main product types that each have their own flat rate shipping cost. When both products are combined in the cart, Commerce will let the user pick the method. ...
0
votes
2answers
21 views

How can I prevent a custom block from rewriting HTML?

I have a self-contained widget written by a third party that consists of HTML, JS, and CSS. I've dumped it into a custom block with Full HTML (and verified the Full HTML settings are loose enough that ...
0
votes
0answers
9 views

DockSal fails on error mounting volumes

I tried following the instructions from DockSal Boilerplate Tutorial and from Acquia BLT DockSal but still fails Creating boilerplate-drupal8-blt_db_1 ... error Creating boilerplate-drupal8-blt_cli_1 ...
0
votes
0answers
21 views

metatag_display_extender plugin does not exist

I am migrating a Drupal site over, the following error is being received... I have clear cache, did a rebuild and no luck. Any suggestions The website encountered an unexpected error. Please try ...
0
votes
1answer
25 views

Implement an API to use HTTP extensions like CalDAV in Drupal 8+

I want to create a calDAV API endpoint. The client would contact my API using methods mentioned in the sabre DAV client documentation https://sabre.io/dav/building-a-caldav-client/ (sabre dav seems to ...