All Questions

Filter by
Sorted by
Tagged with
-1
votes
1answer
28 views

How to run tests in my contrib module?

I'm writing a contrib module but I can't find the documentation to run the tests - unit and functional. I know that I'm supposed to use PhpUnit, but I can't find examples of PhpUnit configuration ...
1
vote
2answers
52 views

How to programmatically build a page and a form in the same page

What I'd like to do is build a page with two things: On one half of the page, custom markup with data from Drupal. On the other half, a custom form also submitted to Drupal. There are a lot of ...
0
votes
2answers
42 views

Run validation callback before ajax

The submit element on my form uses an ajax callback which sends out an email. I have a validation callback which I've added to this form, but it gets run after the ajax callback and so the email will ...
0
votes
0answers
32 views

Alter a Field Collection display order inside a FieldCollectionHook

I have been stuck in here since yesterday and I'm starting to run out of ideas. I have a Field Collection that contains 2 fields. The first one is a multiple taxonomy term, and the second one is a ...
-1
votes
1answer
39 views

Webform element validation custom module

I want to add a custom validation to text input, I followed the instruction provided in https://www.drupal.org/docs/8/modules/webform/webform-cookbook/how-to-add-custom-validation-to-a-webform-element ...
1
vote
1answer
43 views

Change field label used in node display

I have a custom content type in Drupal 8.6.x. I want to be able to change the text used for a field label based on the value of a taxonomy term reference in the node. For example, I want to change ...
0
votes
1answer
71 views

Why is $form array empty when extending FormBase or NodeForm

Why is $form not upcast with the requested bundle's fields for the default Form Mode for GET requests; and with the entities' values for other method requests? My form: namespace Drupal\tam_api\Form;...
0
votes
0answers
16 views

Limit the number of characters of Node Body(summary) in Search Results

In Drupal 8, I am using 'Search API' template file to display search results. My each page has more than 1000 words content. When I perform a search it display the results correctly, but I see the ...
0
votes
0answers
19 views

Import/export content to CSV along with the field collectors

I have added the "field collector" fields in the content type to create relation ship between 2 content types and they are looking good but i want to load the data for the content type from the CSV ...
-2
votes
0answers
35 views

“Display even if view has no result” option in returns unexpected results [closed]

On a Drupal 8.7.3 project, I have a view described as below: Format: Table. Display: Fields. The view displaying content of type: "xyz". The view has a relationship to the group where the "xyz" ...
0
votes
1answer
12 views

Views Add Link to product field missing

I have a search results View which list the (Commerce) products. I show the title and the image fields. I those fields to wrap in a custom <a> link tag. When I am adding fields, I miss the 'Link ...
0
votes
0answers
19 views

url_alias has issues with node_translation

I am migrating a site and after debugging I am seeing the following when the node_translation plugin is executed. Source is taxonomy/term/1 and when transform() is executed pid is set to term instead ...
1
vote
1answer
21 views

Where are the settings for read time module in admin area? [on hold]

Installed the read time module and can not find any settings in the admin area. The description says its configurable, but where? I can see the field in manage display, but the article is not ...
2
votes
2answers
90 views

Allow some products to be sold only in bundles (groups) with some other products

I'm making a commerce site with Drupal 8 and Drupal commerce and I have a not so common request. Some of the products should be available to buy only in groups (bundles) with some other products. E.g. ...
1
vote
1answer
41 views

Add CSS class to view image_field in twig

In my custom view fields twig file views-view-fields--search--product_result.html.twig I try to theme my view item. {{ fields.field_images.content }} <h5 class="card-title">{{ fields.title....
0
votes
0answers
25 views

User register returns 409 [closed]

I developed a mobile app that interact with the d8 site rest api using the /user/register?_format=json where in some devices the register returned a 409 conflict and the user is not even registered ...
0
votes
1answer
18 views

How to set “Language Selector dropdown” required in node form

I want to know How to set "Language Selector Drop-Down " required in node form? I tried to do this via hook_form_alter, but it seems $form['language'] is not created in this hook ! Is there any hook ...
0
votes
0answers
46 views

Set Custom Form Element Value in Extended LinkWidget Class

I have a class extending LinkWidget and would like to add a new form element. I have omitted all code except what I have added: class CustomWidget extends LinkWidget { public static function ...
-1
votes
0answers
33 views

hook_form_alter() does not work

I have created a form by web-form module in drupal 7 now I am using a form_alter hook but it is not working here my code function gievances_form_alter(&$form, &$form_state, $form_id) { ...
-2
votes
0answers
20 views

Showing field information in node edit

I am currently showing the data from different content type (Products) to another content type (Orders) through the module "field collector" and it is working fine. But, it is showing the field_id ...
-1
votes
1answer
34 views

Organizing config for use with a module

I've recently learned about adding a config/optional directory to a module to provide config items that will be imported upon enabling the module if there are no conflicts. Is there an easier way to ...
1
vote
1answer
20 views

Is there a standard place 3rd party module pages report what PHP version they're tested on?

Is this info reported anywhere? for e.g. https://www.drupal.org/project/optimizely or https://git.drupalcode.org/project/optimizely
-2
votes
0answers
15 views

Changing Styling of Search API search results page

In Drupal 8, I am trying to customize the Search Result page. I am using 'Search API' not default 'Search' of Drupal 8. I have got the template file from /modules/search_api/templates/search-api-...
0
votes
0answers
9 views

How do I retrieve tagged nodes as well as untagged?

I have a View, "Product Reviews", that retrieves all Product Review nodes (custom content type) that are tagged to the Product you're currently viewing. So, if you're on the page for Product XYZ, this ...
0
votes
2answers
36 views

How to achieve clean HTML markup?

If you visit official website of Dries Buytaert https://dri.es/ and look into the source you will see very clean and minimal markup with no unnecessary tags and classes, eg: When I create a simple ...
0
votes
1answer
29 views

How can I set value to hidden field (Form Api) and send them with post method?

I’ve created a form with Form Api in a custom module. I send datas with post method to a web service. In buildForm() $form['mode'] = array( '#type' => 'hidden', '#value' => '...
0
votes
0answers
16 views

Replace the first tab in the user profile

In the user profile, I try to replace the first "View" tab with a new tab with views. So I add in "Page settings", for Path: / user /% user, and Menu > Title link menu: My tab > Parent: user ...
0
votes
2answers
20 views

Node ID from hook_comment_insert [duplicate]

I need the ID of the node the inserted comment is attached to. This is what I have tried: function my-module_comment_insert(Drupal\Core\Entity\EntityInterface $entity) { // According to https://...
1
vote
1answer
26 views

Disable “Operating in maintenance mode. Go online.”

The solution for Drupal 7 is using the following code, as per answer of How can I disable the message “Operating in maintenance mode. Go online.” in maintenance mode? function mytheme_preprocess_page(...
0
votes
0answers
31 views

Display views result from views_json_query in another view [on hold]

I am trying to to show the results from a views_json_query in a table in another view. But I just don't get it working. I read some tutorials about view in view and there are contextual filters ...
0
votes
0answers
34 views

Drupal::httpClient() and proxy settings

I've defined a proxy in my settings.php: $settings['http_client_config']['proxy']['http'] = 'http://ip:port'; $settings['http_client_config']['proxy']['https'] = 'http://ip:port'; $settings['...
0
votes
0answers
19 views

Avoid processing a queue during cron execution [closed]

How we are able to ignore some items from the queue and doing them in the future? For now, when I run cron all queue item will consider and any action that I want on them will apply. but I want to ...
-2
votes
0answers
13 views

Drupal 7 advance forum problem [on hold]

I found a problem on the Drupal 7 advance forum. The number of posts I posted is now 1780 pages but shows less in pagination.
0
votes
2answers
45 views

How to install a specific version of Drupal using Composer

Composer always installs the latest version of Drupal core, I want 8.6 not 8.7. How can I achieve this?
0
votes
1answer
20 views

Following Drupal 8 Commerce custom offer tutorial, but getting “name already in use” error

I am following the tutorial for creating a custom offer at the official Drupal 8 Commerce documentation. But I'm getting an error that I pasted below when I click on any of the conditions, and none ...
0
votes
0answers
21 views

Creating block of category 'commerce' to show shopping cart contents

I am new to drupal, and am trying to create a commerce page. I have created a basic page, and I am now trying to add a block which lists the products in the shopping cart. I am using an existing ...
0
votes
1answer
28 views

Access fields of node content type from event “rules_entity_insert:comment”

In Rules 8, I know how to make custom fields of a content type accessible in an event "After updating a content item (rules_entity_update:node)", that is: Condition: Entity is of bundle Entity: node ...
0
votes
1answer
9 views

View with relationship - column displaying count of related nodes

I have a content type ("Interviewee") and a Media entity using the new media stuff in core (e.g. Remote Video) which have entity references back to the Interviewee entity. I then have a view of the ...
-1
votes
0answers
41 views

Blank page when increasing elements

When I create a view and I increase the number of elements to be displayed above a certain amount, the page of the view is blank respectively I get error 500. If I decrease the number it works ...
0
votes
0answers
13 views

How to merge 2 term reference fields from 2 content types programmatically

I am looking to consolidate two term reference fields from two different content types into one term reference field used in both content types. I would like to try and do this programmatically and ...
0
votes
0answers
25 views

How to force pathauto to bypass common word removal based on content type?

If one set up a url pattern for nodes of certain type to node/[node:title] and then try to create a node with title this is my title the generated pattern is node/my-title. This is because pathauto ...
0
votes
1answer
27 views

Format date field in twig

Date field having multiple values. Need to format the output. {% for item in items %} <div{{ attributes }}>{{ item.content|date(format="F j, Y") }}</div> {% endfor %} item.content ...
0
votes
2answers
35 views

CSS changes not updating

Basic caching settings all off: settings.local.php is loaded: Bottom of settings.php: if (file_exists($app_root . '/' . $site_path . '/settings.local.php')) { include $app_root . '/' . $...
0
votes
1answer
23 views

How do I create a time range form field?

Is there any way to add time range input fields in a form, for example using code similar to the following one? $form['notification_hours'] = array( '#type' => 'time_range', // type time_range ...
0
votes
0answers
33 views

Remove a widget item with an Ajax callback (in an entity browser widget)

[edit to add]: 1-The ajax callback is made from a field (field_company) inside the regular user_form 2-The logic and the callback definition reside inside the hook_form_alter of the user_form => ...
0
votes
0answers
33 views

Geocode from an existing field only works for first node

I am currently working on my personal website that showcases my photos. The location of all images will eventually be shown on a Leaflet map. EXIF data work mostly fine, but I cannot automatically ...
0
votes
0answers
34 views

Files migration issue

I am following this tutorial on how to migrate files from D7 into D8. I have the migration setup with the following yml configuration: uuid: a685a4e0-1022-4bf2-a787-f6f1bef587ea langcode: en status: ...
0
votes
1answer
12 views

jQuery not working with JS Injector

I've put the following jQuery into JS Injector on my Drupal 7 site: jQuery(document).ready(function($) { console.log( "ready!" ); $(".org-chart-detail-box").css("background", "green !important")...
-2
votes
1answer
29 views

Is hook_field_group_build_pre_render_alter() deprecated?

I just came accross hook_field_group_build_pre_render_alter when I was trying to add visibility #state to a field group on the User Regsiter Form (Hide a CCK fieldgroup using #states in ...
1
vote
1answer
16 views

Remote attribute in mymodule.libraries.yml

When creating a library, I noticed there is an attribute remote that can be added. I cannot really find any good documentation as to what it is for nor does it seem like it is required. Questions: ...

15 30 50 per page