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
23 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
19 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
57 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
38 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
28 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
20 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
26 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
18 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 ...
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
17 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
15 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 ...
0
votes
0answers
7 views

Get date exposed filter value

I have a view with a date exposed filter. I need use this date exposed filter value in custom php code. How can I get current date exposed filter value?
0
votes
0answers
21 views

Getting “EntityMetadataWrapperException: Unknown data property” error when I delete a users custom field

I have added extra fields to the user object. One of the fields I have added was a Skype text field to hold the user's Skype contact information. The field had a machine name: ...
3
votes
1answer
22 views

404 Not Shown For Custom Module - Drupal 7

In a hook_menu() implementation, I am defining a route for login. function my_account_menu() { $items['login'] = array( 'title' => 'Customer Login', 'page callback' => '...
0
votes
0answers
15 views

How to edit the line item manager widget in Drupal Commerce?

On the Commerce Order edit form, we can add a product manually. Using the autocomplete field Product SKU, you may find the exact product you need to add by browsing among SKUs. Unfortunately, I can ...
1
vote
2answers
109 views

Change remove from cart button to an image button

I want to change the remove-button, that removes line items from the cart to an image button representing a trash can like this: The code I am using in a custom module looks like this: <? php ...
0
votes
1answer
23 views

How to alter the search api views exposed form field value?

I have a search api view. Which has an exposed some exposed filters. The exposed filters contains postal code, city and latlong field. The user will enter the city and postal code and then in the ...
0
votes
1answer
21 views

How can I get lat/lon from an address?

I have these modules addressfield geofield geocoder Is there any function to which I can pass an address like Stree, zipcode city, Country and it returns a lat/lon from that address? I have ...
0
votes
2answers
21 views

How to change the value of a commerce token?

When an order is submitted on our D7 site an email is sent to us with all the details of the order, including the payment method. I use the token [commerce-order:payment-method] in the commerce email ...
0
votes
0answers
8 views

Distance based search view to filter on near by location

I have these module installed. geocoder geofield geofield_map addressfield gmap I have a geofield field in my content type which saves the lat long from the address field. I have created a view, ...
1
vote
1answer
26 views

How to modify the D7 user login page html to remove the register and new password options for non-admins?

So, I'm maintaining a Drupal 7 site for which we recently switched the users over to SSO through a third-party OAuth provider. The implementation isn't fancy, but added a login link to what I assume ...
1
vote
2answers
34 views

After restoring, incorrect database credentials are used

I am trying to get a local drupal environment up and running using an sql dump from a production environment. I am attempting to follow instructions from drupal's documentation. So far, from our ...
0
votes
0answers
21 views

How to use oauth2 authorization in feeds importer?

I did it the postman like the following steps In the authorization tab, I selected OAuth 2.0 as Type. Then clicked on get new access token. I selected grant type as Client Credentials. Added access ...
0
votes
0answers
17 views

Back Up Migrate hangs and never completes

I am running into an issue where running drush bam-backup is never completing. It ran for about 18 hours and nothing happened.. The command works and completed on our staging server within about 45 ...
0
votes
0answers
17 views

How to combine two operators in search api full text search?

I have a search api view. I have an exposed filter for full text search. In the filter settings, I am using search keys and in Query settings I have selected multiple terms. I used this settings ...
0
votes
0answers
25 views

How to add meta tag to a hook_menu page which return json output?

I have a custom page which I have created using hook_menu $items['list'] = array( 'page callback' => 'page_callback', 'type' => MENU_CALLBACK, 'access arguments' => array('access ...
-2
votes
1answer
42 views

Installing a module on a separate database

I currently have a Drupal 7 site with a big database. I have to install the Drupal Commerce module and I would like to install the module using a separate database. I know I have to setup the second ...
0
votes
1answer
22 views

VBO: “Change owner” Vs “Change the author of content”

I would like to change the author of a content for a bunch of nodes. So I've chosen Views Bulk Operations (VBO) module to achieve it. Part of it, created a VBO view, but in the VBO options I see "...
0
votes
0answers
18 views

Can't print any field using entity_metadata_wrapper

I'm cloned an existing D7 site onto a new computer that I've worked on many times before, but I have a problem I've never seen before - I can't print ANY field using entity_metadata_wrapper. The ...
0
votes
0answers
16 views

Duplicate published content to another language

I have a big question without a solution, but I can't believe it doesn't exist. I have a site in Portuguese and one in Spanish, I want to pass the contents of "pt" to "es", how would I do it without ...
0
votes
2answers
31 views

Setting up an exposed filter to only filter conditionally

I am trying to build a D7 view, and I have the view correctly only showing results using a contextual filter, but I am trying to build one more filter (an exposed one), to drill down even more. I ...
0
votes
0answers
8 views

How to fix malformed geometries in geofield

I have a form that allows to add geometries to a node. It features a geofield map widget where you can also add geometries using a WKT field. Plenty of users have used this field. However, some of the ...
0
votes
0answers
11 views

Storage API + Services 3: How to work together?

I am trying to set up a site that will be storing a large amount of images. I am using Storage API module for that and It is working fine through web. Now I need a REST Service to upload images. I am ...
0
votes
0answers
10 views

How to show referenced products on the individual page view of a product

I use Page Manager to override the individual product display node. I use a panel to show the product. In each product variation the shop owner can reference multiple products via a custom-created ...
0
votes
1answer
19 views

Show active taxonomy term as title of product category view

Commerce kickstart comes with a view named Collection products that shows: a Collection of products (Product display). In the relationship's tab of this view there are 2 relationships: 1. Product ...
0
votes
0answers
22 views

Dynamically created elements trigger wrong submit handler post AJAX event

I've found that dynamically created submit handles will adopt the first declared submit function in a form after an AJAX event has been processed. Demo code: <?php function form_test_main_form($...
1
vote
1answer
25 views

Uncaught Error: Call to undefined function db_table_exists() [closed]

Does anyone have an idea of why I would get this error ? PHP Fatal error: Uncaught Error: Call to undefined function db_table_exists() I'm running a script from a working Drupal site, using bash ...
0
votes
1answer
46 views

Using a sweet alert with preventDefault()

I have an event on a form submit. I set preventDefault() to stop the form submitting then pop a sweetalert with a confirm callback. If they decide to go ahead is POSTS the form to Drupal. The issue ...