All Questions

Filter by
Sorted by
Tagged with
0
votes
0answers
13 views

Configurable Action Form Builder Not Called by Views Bulk Operations

I have a configurable Action that I implemented back in VBO 8.x-3.8, and it was working fine. <?php namespace Drupal\my_module\Plugin\Action; use Drupal\Core\Action\ConfigurableActionBase; use ...
1
vote
3answers
766 views

Hide products from a view

I know this may be very basic but I can't seem to figure out a way to hide a product that I've got set up in Drupal Commerce. I'm new to Drupal so thanks for your patience. I am using the Expressa ...
0
votes
0answers
17 views

Getting intermittent AJAX.js error on a Commerce site when changing product variation dropdown menu

We've been trying to troubleshoot this issue for weeks now without luck and am really hoping someone here can help point us in the right direction. We have a D8/Commerce 2 site with a **very ...
0
votes
1answer
31 views

How do I ensure new dependencies added to the info.yml of an existing enabled module are picked up?

I've added dependencies: - core/jquery - core/drupal to mymodule.info.yml (where mymodule is my module name). How do I ensure Drupal "sees" these new dependencies? For example, can I ...
0
votes
1answer
648 views

Rate module thumbs up / down widget with button

I am using rate module to count likes and dislikes. Here I am using Thumbs up / down widget. My question is that how can I show a button below thumbs up and dislike button below thumbs down. In the ...
0
votes
0answers
10 views

How move_upload_file calls to custom stream_wrappers class

In a node form, I upload a image to the server via ajax and before to send to the uri, I want to optimize the original image (not a image style). How is possible that from move_upload_file that is a ...
-1
votes
0answers
24 views

Best way to load bootstrap.js in all pages [closed]

What's the best option to load Bootstrap JavaScript? I need to load Bootstrap.js on all pages. There is a way to do this in libraries.yml It works, but the problem is when bootstrap.js is already ...
0
votes
1answer
679 views

Providing a default value for an Entity Reference Field using Views Bulk Operations

I have a content type called 'Schools' and a CSV spreadsheet that has columns for information such as School Name, Location, Telephone etc... Using Feeds I can import the information on the 111 ...
3
votes
4answers
1k views

Entity Query field condition for Webform submissions

I'm trying to query webform submissions based on a field value. The field is called "ticket_for". Somethings I tried and do not work: ->condition('ticket_for',$adnummer) ->condition('...
5
votes
4answers
9k views

How to properly add inline Javascript?

Now that drupal_add_js(...., 'inline') is no longer possible, how can I inject dynamic Javascript from a custom module's Controller? (I'm trying to upgrade a D6 module with as little refactorings as ...
0
votes
1answer
613 views

Views Bulk Operations Checkboxes check on click

I do search for a specific option in bulk operations. For now, when I click somewhere in my row, the checkbox for the bulk operation gets selected, but I want a user to directly click on the checkbox. ...
-2
votes
1answer
28 views

The admin toolbar is messing up the sticky position set with fundation

i am using the sticky component from foundation to render a sidebar element sticky. It does work when unconnected but when connected the toolbar cover the sticky element. How could i fix this ? ...
5
votes
6answers
9k views

Submit form and disable submission button

I want to disable the submit button after it is clicked to prevent multiple submissions. I have: $form['show'] = [ '#type' => 'submit', '#value' => $textforsubmitbutton, '#name' => '...
0
votes
1answer
862 views

CSV migration always returns “id is defined as a source ID but has no value”

I have a freshly composer installed Drupal 8.6.13. I tried to migrate csv sources and allways got the error message [error] Migration failed with source plugin exception: id is defined as a source ...
0
votes
1answer
519 views

Loading module-related files only on certain pages

I installed the Chosen module and it is conflicting with my JavaScript code. That module gets loaded on every page, even if there is no select box on the page. It is definitely unnecessary to load the ...
2
votes
1answer
2k views

jQuery Mobile in a custom theme

I have built a Drupal 7 website that contains a mobile theme. What I want to do is run the newest version of Jquery Mobile - http://jquerymobile.com/ which requires Jquery 1.7.1. Drupal by default is ...
14
votes
4answers
4k views

Delete a node after X weeks it was created

How can I delete a node after, for example, 2 weeks it has been created?
0
votes
0answers
7 views

Image can't be removed from widget after validation using entity validation api

I have created new media type(movie image). In that media type, I have two fields image and boolean field, I have referenced the movie image in content type and set upload limit of images to 10 and ...
0
votes
2answers
556 views

How can I force users to input a shipping address when using the Commerce Paypal WPS submodule?

I just built a store in Commerce using Drupal 7 and I am taking payments by the Commerce PayPal WPS submodule. However, when I tested checkout, I found it was possible to buy a product without ...
0
votes
1answer
336 views

How to count the number of votes for each star in fivestar?

I'm using Drupal 7, Voting API and Fivestar. I try to count the number of votes for each star, and display the percentage, like : It is at present possible to have only the number of total vote. ...
0
votes
1answer
37 views

Populating Select2 with AJAX

I am trying to populate a selec2 field on open with AJAX in Drupal 8. In my hook_form_alter, I have added the following code: $form['#prefix'] = '<div id="form-ajax-wrapper">'; $...
0
votes
1answer
467 views

Price formatter for range of variation products

Is there a way to write a price formatter to display the lowest and highest price of a collection of product variations? My reason for thinking it might not work is the scope of the product variation ...
1
vote
1answer
25 views

How to exclude contributed modules from being upgraded when we run composer install or composer update?

I want to exclude contributed module Ubercart from being upgraded when we run composer install or composer update ? What change should I add in the composer.json so that it ignores ubercart ...
-2
votes
0answers
22 views

How to do query from sql and display result in twig in drupal 8 [closed]

I am new in drupal. I made modul, controller and twig now i need to do query and display result of custom content type on page. Can somebody post me code to see how to do it in which file. Thanks for ...
0
votes
2answers
337 views

Translations string email not work

in D8 (multilanguage site, with two languages) i wanna send email for registration, etc by user preference of language of user (People -> Edit people -> Language Settings) I've enabled all modules ...
0
votes
1answer
10 views

How to detect order type (recurring or not) in order confirmation and shipping confirmation email templates?

When order is placed an emails is sent to the user generated with template commerce-order-receipt--default.html.twig When order is shipped another email is sent to the user, now generated with ...
0
votes
1answer
396 views

Search not finding search term from page title

Using the default database search index in drupal 8, when I search for a term from the a page title, sometimes it shows the result and sometimes it shows nothing, even though i enter the exact page ...
3
votes
2answers
3k views

How do I add a node field widget to a custom form?

I added a number of fields to a node content type in Drupal 8. I want to create a custom form and add the field widget form (the one used during node creation) to this form. How can I achieve this?
0
votes
1answer
868 views

Adding custom data to the node object

I have created a content type called providers and when editting said content types users can fill in extra information related to the content. I have included said form fields using hook_form_alter, ...
3
votes
3answers
21k views

How do I include a custom JavaScript file in a module?

I want to include a custom JavaScript file in a module using the following code. function profile2_form_user_register_form_alter(&$form, &$form_state) { drupal_add_js('http://localhost/prf2....
0
votes
1answer
680 views

views header (contextual) filter

I have a node type news with a taxonomy reference (news categories). And I have a view for the news. In this view I have a contextual filter by this categories. The category comes with the url. In ...
1
vote
1answer
33 views

Missing updates for Media

After much package dependency finagling via composer, updating PHP, updating MariaDb, etc.. (not as bad as D7 => D8 but still harder than I'd hoped) I managed to update from 8.9 => 9.0.7. I was ...
3
votes
2answers
2k views

How to prevent a PDO exception when using Rules to Set a data value after saving new content?

I need to write a rule that edits some elements of the node, as soon as it is created. Unfortunately Drupal doesn’t like that and crashes whenever you try to save the node within a rule that was ...
-1
votes
0answers
9 views

Geolocation Common Map using Custom Table

I have a custom table with some locations and their details (address, lat, long, etc.). I've also got the geolocation module installed and enabled. I want to take the lat and long from the custom ...
2
votes
1answer
476 views

Arrange formatted fields in Views row using a template

I want to render the rows of my “Recent content” Views page using a template in order to subdivide the rows into multiple divs, freely move around the rendered fields within these divs, and apply ...
0
votes
1answer
334 views

Scheduler Module crontab job does not publish content

When running the Scheduler lightweight cron through crontab, I am getting a message that the lightweight cron has activated and completed in my D8 log, but content is not publishing. When running the ...
0
votes
2answers
460 views

how to create a taxonomy Views combining terms from 2 different vocabulary

I have content types tagged from two different vocabularies (destination and category). i.e. destination (main vocabulary, content must be tagged with of one of them) - dest1 - dest2 - dest3 - dest4 ...
0
votes
1answer
462 views

How do I avoid behaviors are invoked after an AJAX call?

I have a search result page, with the first set of data being fetched during the page load, and we add a Load More button. Clicking on this button fires an AJAX call, using the ajax_links_api module. ...
0
votes
1answer
336 views

Import images from RSS with Feeds module without Feeds Image Grabber

I'm passing all the sites from D7 to D8 and so far so good. But one of my sites gives me a couple of problems. I was populating the RSS site in Drupal 7 using Feeds Image Grabber. Now, Feeds Image ...
0
votes
0answers
13 views

What is the acceptable method for importing addresses via feeds?

I have a list of businesses that I need to import and naturally they all have addresses. However the field address on my content type is not targetable during mapping, but all the other fields are. I ...
3
votes
2answers
534 views

Strip HTML tags from Field Collections in Services Views

I'm trying to strip the HTML tags from a JSON response I generated using Services Views, but I'm not having any luck so far. I have a content type with a Field Collections field in it that is ...
0
votes
1answer
592 views

String replace with rules

Is there a way to string replace with rules? I'm trying to find some way to transform values without changing a value entirely. Is there something I'm missing, or should I just make a custom rule ...
1
vote
2answers
689 views

How to set and inherit variables within different twig templates?

I'd like to set a variable in my node.html.twig template: {% set title = label %} {{ content }} The content consists of one field visible only, which has it's own template: file-link.html.twig How ...
2
votes
2answers
71 views

How do I disable the default node creation form for a particular node type?

I have a node type recipe, which should only ever be created via a custom route that causes it to be linked to a parent food type, ie. if the user visits node/add/recipe/1 they will see a recipe ...
0
votes
1answer
337 views

How to download file from URL manually?

I need to upload on Drupal 8 a file from an URL programmatically without using a form and a field type 'managed_file'. I'm not sure how to do this, I found different web pages on it but it's often ...
0
votes
1answer
999 views

How do I throw values calculated back to buildForm()?

I am trying to throw back values that are calculated in submitForm() to buildForm(). How do I add more state values into it? /**  * @file  * Contains \Drupal\resume\Form\ResumeForm.  ...
0
votes
2answers
367 views

Features to import content types

Features seem to be the right way to import custom centent type in a fresh D7 install from a D6. But when I create my feature on the D6 one, it added dependencies like modules,and once I import the ...
6
votes
2answers
443 views

Managing custom aliases on translated content

We have a Drupal 8 site with translated content, and using the Pathauto module. The issue we are running into is that when we un-check the "Generate automatic URL alias" on, say, the Chinese node, ...
1
vote
0answers
24 views

Drupal + XDebug + VSCode = can't break on PHP notice or warning

Using Drupal (8.9), PHP (7.2.34) with xdebug, and VSCode (1.50.1) with PHP Debug (1.13.0), the debugger will no longer break on PHP notices and warnings, even if those option checkboxes are set. The ...
-1
votes
0answers
10 views

Search API XSS issue

Using the search API documentation, built a form in the header that passes the search text to the search page. https://www.drupal.org/docs/8/modules/search-api/getting-started/common-pitfalls When ...

15 30 50 per page