Podcast #128: We chat with Kent C Dodds about why he loves React and discuss what life was like in the dark days before Git. Listen now.

Questions tagged [7]

Version tag to tag issues specifically related to Drupal 7.x. Please note that version tags should be used only 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
0answers
14 views

How can I make the coupon code field in commerce mandatory?

Using D7 commerce coupon/discount modules. I need to make the coupon field mandatory. There is no standard "required" checkbox on the field and I tried using conditional fields module to no avail.
0
votes
1answer
16 views

Override a file from the parent theme

Adding in the child theme a CSS file with the same name as the parent theme CSS file overrides the parent file. It doesn't seem to work JavaScript files. How can I override a JavaScript file loaded ...
0
votes
0answers
26 views

Remove duplicate records from view result with pager

My project is setup in Drupal 7 and i am using search API for display my custom search result. Actually i want to show search result based on two content types content so i have configure the search ...
0
votes
1answer
12 views

How to create programmatically multiple URL alias of same taxonomy term?

I have category cars and I want to create its URL alias according to the region like if the user location is Australia than URL will mysite/australia/cars similar if the user location is USA than URL ...
0
votes
1answer
15 views

Alter Add to Cart form POST data provided by #action

I am going to be phasing out Drupal Commerce on our website in favor of a new custom built application that is hosted at another URL. Without completely rebuilding everything I am trying to override ...
0
votes
0answers
16 views

Related nodes view block based only on child Taxonomy Terms

I have a 2-levels Taxonomy Hierarchy structured like this: Parent Term - Child Term 1 - Child Term 2 - ... My goal is to create a view block, where related nodes based only on child ...
1
vote
0answers
25 views

Help me write a Rule condition and action to remove discount line item and to add payment

I am trying to write a rule for an existing order. Order has a zero total due to (Commerce) discount, e.g.: Widget $3.00 Discount -$3.00 For the condition, I'd like to check if a specific discount is ...
1
vote
2answers
38 views

Override a function in a contrib module

My company received a maintenance contract for a website developed in Drupal 7. The Drupal 7 website uses the Quiz contrib module, ver. 7.x-4.0-rc10. The module is used to implement a feature where ...
-5
votes
0answers
65 views
+50

Installed module not working

I have a website hosted in Pantheon and I am trying to install the Security Kit module to the live website. I tried installing it on DEV (dev.website.com) environment, and then moved the code to ...
0
votes
0answers
16 views

CKEditor doesn't work after updating

I've updated a drupal website to the latest 7.x version, and CKEditor stopped working. I had it originally getting //cdn.ckeditor.com/4.5.4/full-all, I've updated to //cdn.ckeditor.com/4.13.0/full but ...
0
votes
1answer
19 views

views_get_current_view performance

Does this function views_get_current_view inside views header or footer (to count rows number for example) means running the same view twice? Or is it somewhat simplified version of running full view?...
2
votes
2answers
42 views

After changing a webform multi-select field to single-select, submissions made pre-change show only the first selection

I've created a webform in Drupal 7 with a component drop-down list. I selected 'multiple' for multiple selections. Now, I need to unselect 'multiple' giving users just one choice of the drop-down ...
0
votes
0answers
27 views

hook_default_rules_configuration can't debug it or force it to load

I am trying to debug a hook from title, here it says http://api.drupalhelp.net/api/rules/rules.api.php/function/hook_default_rules_configuration/7.2 "This hook is invoked when rules configurations ...
0
votes
3answers
45 views

How do you deploy a change to a main menu?

We have a small D7 site. We want to deactivate a main menu item. On dev server I was able to deactivate it in /admin/structure/menu/manage/main-menu I believe The menu is stored in the DB, right. ...
0
votes
1answer
12 views

MiniOrange SAML SSO Drupal Module – Multilanguage Support

This is my first post at Drupal StackExchange. Please feel free to redirect it to the proper forum if this is the incorrect one. How do I configure Apache Server so that MiniOrange SAML SSO Drupal ...
0
votes
0answers
18 views

Dependent fields

I have 3 content types; team, player and game. When adding a new game, I would like user to first select team, and have the player list loaded only for that selected team. Is there a module that would ...
-1
votes
1answer
18 views

How can I programmatically create a Profile 2 profile?

I am taking a look in the Profile 2 API documentation: http://api.drupalhelp.net/api/profile2/function I guess profile_create() or profile2_save() are what I need. But I have read somewhere ...
0
votes
1answer
20 views

voting entity reference field

I have two content types, game and player. Each game can have a number of players assigned to it. I would like to have the capability to give votes to each player in a game. What are some ways to do ...
0
votes
1answer
26 views

How do I know when another contributed module deletes a block?

I have written a Drupal 7 module that adds about ten fields to the block administration configuration form and saves the values for those fields in its own database table. My module does not create ...
0
votes
2answers
26 views

Form submission handler is not executed

In a module, I am using the following code. function mysimple_form($form, &$form_state) { $form['#method'] = 'get'; $form['#action'] = '/buy/{_val_}'; $form['search_location'] = array( ...
0
votes
1answer
34 views

How can I disply the regex match in a view?

This is a Drupal 7/Views 3 question. I am using a regex as a filter in a view to select Body fields with certain characteristics. However, when it comes to displaying the field, I don't want to ...
0
votes
0answers
21 views

How can I write query of search api to get row count for every condition

$query_search_api = search_api_query('search_products', $options); foreach($arrFilterSa as $machine_code => $efield_value) { if($efield_value) { if(...
0
votes
0answers
30 views

“Drupal is initializing” rule firing multiple times

I am using the Rules module and the event "Drupal is initializing" in a rule to check if a user has clicked their confirmation link in their email that Drupal has sent them to verify their account. ...
0
votes
0answers
16 views

How can i get node type in template.php [duplicate]

I want to configure breadcrumbs depending on the node type. How can I get the node type in a function theme_breadcrumb in template.php? I try it, but it doe't work. function zen_breadcrumb($variables)...
0
votes
1answer
23 views

How do I construct an authenticated HTTP request in Postman?

I have Drupal 7 installed locally on my computer with the domain set to http://drupal.local. I am trying to prepare an external script in PHP or Python (or even in pure Bash using curl, if it does ...
-1
votes
0answers
27 views

Fatal error: require_once(): Failed opening required - Will not display photos

I am not a 100% certain how this happened because some time has past since I did an upgrade, yet the upgrade could be the reason I am getting the following error: Fatal error: require_once(): ...
0
votes
0answers
22 views

Is it possible to auto-translate a block?

I am hosting a Drupal 7 site and require some quick translations. I have found how to set up some auto-translations which I can then modify for all the content types (articles, basic pages, etc), but ...
0
votes
0answers
17 views

Access Denied when Sellers add new product

We created a store with Drupal 7 Commerce. Because we wanted to let specific users create new products on our store, a user role Seller was also created with the following permissions: Create, edit, ...
1
vote
2answers
56 views

Does hook menu accept a wildcard as argument 0?

In a custom module I have implemented hook_menu() using the following code. function MYMODULE_menu() { $items = []; $items['%/review'] = [ 'page callback' => 'review', 'page ...
0
votes
1answer
22 views

restrict page callback url?

With this callback code - is it possible to restrict url just to be example/page1 (2 arg) but not example/page1/321 or example/page1/abc/efg...? // hook_menu example function example_menu() { $...
1
vote
1answer
35 views

Generate PDF with wkhtmltopdf after batch finished

I would like to generate a pdf with wkhtmltopdf at the end of my batch. I integrate the generation in the callback function but it does not offer me the download of the file This is my finished ...
1
vote
1answer
13 views

Using different .inc files with same function names in .module file

In our project, we have this module meant strictly for our custom API endpoints for our mobile applications to use. Currently, this is handled in a single .module file like so: my_project_mobile_api....
0
votes
0answers
20 views

Add helper text to payment method form

I would like to add helper texts to the different options in the payment methods form, in Drupal Commerce, like this: /Radio button/ Payment method 1 Helper text option 1... /Radio button/ Payment ...
0
votes
0answers
17 views

Reference custom entity

I'am on Drupal7 and wanto to reference this custom entity function myentity_entity_info() { $info['myentity_basic'] = array( 'label' => t('Ind (myentity)'), 'controller class' => '...
0
votes
0answers
27 views

How do I get rid of anonymous sessions?

In a Drupal 7 site taken over from an ex-colleague, sessions for anonymous user always are generated as this screenshot shows. The security-scanning service provider always claims: Our ...
-1
votes
1answer
22 views

Translating english node to spanish

How to create a Spanish version of node which is in English and that Spanish version of node should contain all fields from English content except one field. That one field should translate to Spanish ...
0
votes
0answers
17 views

Add the presentation role to an image

I have an events page and I don't want screen readers to pay attention to the image links as each event already has a link associated with it. Having 2 links read out seems like overkill. In my ...
0
votes
0answers
6 views

Simplenews D7 double opt-in view to show who has and hasn't opted-in

I'm trying to work out the % percentage of our users who don't click on the link. I want to set up a view to show all those who have entered their email address in a Simplenews newsletter sign-up box ...
0
votes
1answer
24 views

setup Drupal with Docker: clone repositories via deploy token

I am quite new working with docker. I tried to set up drupal via docker and docker-compose. So far i got a running instance and installed drupal via the installation script. No i want to clone ...
3
votes
1answer
38 views

How do I free the memory used from node_load()?

I am using code similar to the following one. for ($i = 0; $i < 1000000; $i++) { $nid = get_node_id($i); $node = node_load($nid); $data = [ $node->field_1, $node->field_3, ...
0
votes
0answers
28 views

Querying entities taking an insane amount of time

Is the entity system in D7 not very well optimized? I am trying to iterate through 1500 entities using EntityFieldQuery(), and I had to extend my execution time to 300 seconds in order for the ...
1
vote
1answer
17 views

redirect after login in drupal without impacting the password reset functionality

The problem: When using hook_user_login to redirect a user to the correct language this is also triggered during password reset. And the hook params do not provide a way to deal with this. This How ...
0
votes
1answer
9 views

How to make Panel Page variant selection rules detect URL parameter?

On D7 I have set up a new panel page variant and want to use it with a certain selection rule: String: URL path Current path is "*/cars/*?buy" Eg I want this panel variant to be used if the URL ...
-1
votes
0answers
15 views

Using the Webforms module, is there a way to establish workflow?

I am using Drupal 7. Using the Webform module, is there a way to incorporate role-based workflow? For example, an authenticated user can fill out the first half of the form, then a user with Manager ...
0
votes
0answers
26 views

Modify entity values with Views Bulk Operations failed (PHP Fatal error: Cannot unset string offsets)

Related question : How to deal with PHP Fatal error: Cannot unset string offsets in field.default.inc when implementing custom widget? Working on Drupal 7.67 with Views Bulk Operations 7.x-3.5 ...
0
votes
0answers
18 views

dropdown multiple values

I am trying to display multiple values of drop down and store it to the database. How could I do that? Any help would be appreciated. $form['options'] = array( '#type' => 'value', '#...
0
votes
0answers
15 views

Using Payment with Webform and without Commerce?

Has anyone had any luck integrating Webform with the Payment module but without Commerce? I'm considering attempting to refactor Commerce Webform Order so that Commerce integration isn't needed ... ...
0
votes
0answers
14 views

How to prevent page refresh after a button click?

I know this question is already asked, but my problem is different. I have a code field created with Display Suite, that displays an audio player named AblePlayer, with a playlist of three tracks. In ...
0
votes
0answers
6 views

Form still submitted after form_set_error() is invoked [duplicate]

I've a case which is driving me nuts. Form is still submitted after form_set_error() is invoked for an element. I have in form alter function custom element_validation $form['field_test']['#...
0
votes
1answer
42 views

Display the results of a form submit on the same page just under the form

I have created a form and it takes in 3 values which are Brand, Item and Zipcode. The values are queried and the results are fetched the database table. I want the results to be shown in a table ...