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
2
votes
1answer
37 views

Find which views are using Views PHP

I have a project that is using Views PHP, and I'd like to figure out which views are using PHP from this module. This will help me determine if I can easily remove the dependency on the module. Is ...
0
votes
0answers
31 views

isset(($_GET['variable'] ) not TRUE anymore after AJAX submit?

I have a variable e.g. for a search query which i save in the URL: .../page?variable=value I get this variable and save it as a global variable so i can use it in all functions of my file: if (...
0
votes
0answers
26 views

Automatically created Forum vocabulary

When I enable core forum module it does not automatically create "Forums" vocabulary in taxonomy and it uses another vocabulary instead. I've tried to create Forums vocabulary manually and then ...
0
votes
1answer
49 views

Can I get the relationships of a node using node_load()?

I want to load relationships from the node_load(). So for example getting the article content type and loading the author information with the same query. How would I go about doing this? The end ...
2
votes
1answer
47 views

How to add certificate to drupal_http_request()?

I am currently setting up a payment method in my Drupal 7 site and following the API documentation for the service I could use this cURL command for testing purposes: $ curl -s -S -i --cert ./...
1
vote
1answer
21 views

SQL Error when updating to utf8mb4

I have successfuly followed the instructions on the Drupal page for updating uft8mb4 except for 1 table which is pulling up the below errror: https://www.drupal.org/node/2754539 Error SQL query: ...
0
votes
0answers
10 views

Webform includes attachments only on manual resend, but not on initial form submission?

Using Webform and Mimemail to send HTML emails and uploaded files attached to emails. When submitting the form, the file is not attached to the email. The box is ticked: But if you edit the ...
0
votes
2answers
33 views

Form rebuild without using buttons

I'm trying to figure out how to rebuild a form without using a button click trigger. Instead, I'm looking to rebuild whenever a blur event occurs on a textfield. All non-button form types lack the #...
2
votes
1answer
67 views

Is jQuery .once() needed if we filter by context?

When implementing a Drupal behavior, a selector can use the 'context' parameter to let the behavior only apply to new elements. On page load the context is the document (I think), on ajax load it is ...
0
votes
1answer
24 views

Does extending a class include the namespace of the extended class? [closed]

For the following example, does ColourSprayTrap:timer() collide with the timer() function that exists in the weapons module? More generally, does a namespace need to be re-declared for a class that ...
1
vote
1answer
40 views

How to keep checkbox checked after form submit

I am trying to keep checkbox "checked" after form submit and page load. I have following simple code from .module file. <?php function my_module_menu() { $items = array(); $items['...
0
votes
0answers
36 views

Views 'uses AJAX' with exposed filter prevents modal opening

I have a views page which displays rows of teasers. Clicking on the H4 title opens a Foundation reveal modal. Here is the views template: <li class="m-social-modal__item column column-block"> &...
0
votes
0answers
11 views

What is the right approach to create a block in a bootstrap theme?

I have a non-Drupal bootstrap 3 theme. I like one of its sections, which I would like to use in my drupal bootstrap theme. I am little confused how I should do it. One simple way is to create a block ...
0
votes
0answers
44 views

Fields missing on “Create a new entity” for Entityform submission

I'm using Rules to create node from Entityform submission. When I add an action with "Create a new entity", there is only one field ("title" value) available. How can I get the other fields from node ...
0
votes
0answers
19 views

LDAP decrypt function throwing undefined offset error

The error shows up on all of the pages of a "secondary" site in a multi-site configuration. The main, default, site does not show the error. The complete error message is: Notice: Undefined offset: ...
0
votes
1answer
13 views

Stop displaying content of subpaths for invalid URLs

I have views set up, with following paths: www.example.com/news www.example.com/projects If a user goes to www.example.com/projects/not-a-url or www.example.com/news/not/a/real/url it displays the ...
1
vote
1answer
12 views

Remove node_access check from content revisions view

For the 'content' Views one can simply check tickbox 'Disable access checks' in UI under Advanced => Query, and the View returns all the records regardless of the node_access check. However, in the '...
1
vote
1answer
29 views

Looking for core Drupal table DDLs

My Drupal 7 installation has a handful of tables that have been corrupted. Attempts to repair them have not been successful so my best chance of being able to move forward is to recreate them. I have ...
0
votes
0answers
21 views

How do I include shipping cost in VAT calculation with Rules?

I have altered the order of the summary items in the summary cart, so that the shipping service is showing before the VAT line. Total amount excl. VAT and shipping 13 735 Shipping cost 160 ...
0
votes
0answers
16 views

How to show shipping service before VAT in summary?

Normally in carts the total amount incl VAT is the last line and VAT is the second last line. Or anyhow that is how I want my cart to look. But when I add a shipping service it appears after the VAT, ...
0
votes
1answer
27 views

Only allow 1 discount using commerce_discount

I am having trouble finding out how to only allow 1 discount per order. eg. a specific user role allows 15% discount on their order. We also have another discount set up that applies a further 15% on ...
0
votes
1answer
34 views

Permissions Rebuild fails

After I installed a quiz module on my Drupal 7 site, it asked me to rebuild permissions. when I try to rebuild it throws this error: I've tried everything that I found online, including: increasing ...
0
votes
1answer
13 views

hook_custom_theme() works except if a user submits a user form with mismatched passwords. Then they get served the admin theme

Title basically. My hook_custom_theme() has been working for ages and I only just realised the admin theme is being served for an error when saving a user form ie. mismatched passwords. A snippet ...
0
votes
0answers
12 views

How to print in views field template the url of a multi field image?

I would like to print in a views field template the url of each image of a multi field image. This is my code but print only the URI $vals = $view->field['field_property_slideshow']->get_value(...
-3
votes
1answer
27 views

Transfer Aegir site to LAMP [closed]

Can anyone please advice me on how to move a Drupal 7 site from Aegir to a LAMP stack? I've been handed the emergency project of moving a site to a new hosting. Ordinarily, that would be easy enough ...
0
votes
0answers
11 views

Entities of type Group and Group_Type are deleted when running drush updb or drush rr

I am using the Group module combined with a feature module. The feature module includes two group types in the implementation of hook_default_group_type as can be seen in here: https://pastebin.com/...
0
votes
0answers
5 views

Unable to install site when attempting to upload a Background Process module

We recently added a new module Background Process to our local drupal environment by running the command drush en background_process -y. After installing, I was able to use the method ...
1
vote
1answer
83 views

Set parameter for internal or external traffic based on IP

We want to block external traffic in Google Tag Manager and I am trying to do something like shown here. I created this: /** * Implements hook_init(). */ function myfunction_init() { $...
1
vote
1answer
23 views

Display summary + read more links if body content is long, otherwise display body alone

We have a content type which has a customized template. In general, the body content of these nodes is short -- one to two sentences at most. In some cases, however, the body content is a paragraph ...
1
vote
0answers
20 views

Incorrect User data being loaded after save

I am running into some data inconsistencies when attempting to load user data after saving the data. Basically, I have a callback that will update a field on the current user object. In a simplified ...
2
votes
1answer
31 views

Is there a way to get the max size of a varchar textfield?

I have an entity with a textfield created using the core Fields feature that looks like this when I inspect the type of the field table in the database varchar(40). I want to be able to determine max ...
0
votes
1answer
50 views

Adding a view block to a basic page

I have been tasked with creating a new basic page that contains displays, the content of some new content type. So far, I have created the basic page and I have also created a new view block (i.e. I ...
0
votes
1answer
15 views

Is there a field tpl for body and/or title fields?

I need to add some data- attributes and I am hoping to change it for the body and title fields on article content types. Do the title/body have tpl's that I can modify to add these? Or another method ...
1
vote
1answer
25 views

How to align views pager url with real page number?

When creating pager in views (D7) you get urls with query parameter like page=X by default. But this X does not match actual page number. page=1 is generated for 2 link in the paginator and so on. ...
0
votes
0answers
18 views

CKEditor/Media Gallery Using Absolute URL for images, how to update?

After entering 100's of hours worth of content we noticed that the images entered through the media gallery plugin contain absolute paths, not relative. This means they breaking when we switch domains....
0
votes
1answer
28 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
18 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
12 views

Show possible counts for unselected facets

I'm using Search API with FacetAPI and Search Api Database programmatically to good effect. The problem I am finding though, is that if a facet isn't selected, then it won't return any data on the ...
1
vote
1answer
26 views

Cannot assign roles creating User through REST endpoint

Sidenote, already seen this page, doesn't seem to help: How to create user with role(s) through REST service? I've setup a new endpoint on my platform to try to allow a 3rd party to create users on ...
0
votes
1answer
66 views

Programmatically change the weight of a form element

I have a user activation/registration form with different attribute like Captcha and security questions which are coming from different modules. I want to change the display order of form elements. ...
2
votes
1answer
39 views

How do I check Organic Groups group permissions from a custom module?

I'm trying to show or hide a button based on if a user has permission to post content to a group or not, but I don't seem to be able to call the og_user_access function from my custom module. I've ...
-1
votes
1answer
31 views

Multiple or Single Git Repository

Though this isn't about a Drupal issue specifically, it is specific to Drupal. I'm looking for community opinion on best practices for storing multiple versions of Drupal. In my case, I've got a ...
0
votes
0answers
38 views

getenv() returning empty strings when variables set through MAMP

I am using MAMP to run a local version of our Drupal project, but Drupal is unable to interact with it's environment variables. In MAMP, under the Apache tab I set this line as Additional Parameters ...
-1
votes
1answer
113 views

Fetch and update with foreach loop

I need to update the database. the code I am using was working, but after I have done some Drupal updates, it doesn't work anymore. I'm fetching data from table all is working but when I add code ...
0
votes
1answer
19 views

IP blocking doesn't prevent requests

I am getting a lot of bad requests from a crawler at a specific IP Address non-stop. I added the IP to the blocked list and cleared the cache, but I still see more requests in the dblog coming in from ...
0
votes
1answer
128 views

Recommended Drush version to use and install for Ubuntu 19 with PHP 7.2 and running Drupal 7

It's been awhile since I've upgraded my server and I'm setting it up from scratch. I'm using Ubuntu 19, apache 2 and PHP 7.2. My site is Drupal 7 which is still running php 5.6 in my old server. I'm ...
0
votes
0answers
82 views

Uploading xlsx-file changes permissions of the file? Errors when loading via PHPExcel

My goal is to let the user upload a xlsx-file and then read the file to create objects. So i created a file upload page in my custom module where the user can upload a file via the 'file' form field ...
0
votes
0answers
19 views

Ajax in a template file to show the value of session variable

I have a webform in my node.tpl which action points to hook_menu url of a module. When the form submit happens, it compiles the form data in the custom module and stores the response value in a ...
0
votes
0answers
20 views

Nginx URL rewriting giving 404

I have a URL of something like www.something.com/development/2019/06/24/xxxxxxxx and I have rewrite it to www.something.com/news/xxxxxxxx I have written following code in nginx rewrite ^/...
0
votes
0answers
14 views

Search API index one of many fields as one field

I have a site-wide search page that's powered by Search API and Search API Solr. It returns results straight from an index that contains content from various entity types (files, nodes, taxonomies, ...