Questions tagged [7]

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
1
vote
1answer
95 views

Modified user record during presave hook not saving properly

A project I am working on has a bug where an array field on the user object is getting duplicated values. To fix this bug, I am implementing the hook_user_presave hook in one of our custom modules to ...
0
votes
0answers
12 views

Hook to call a function after menu rebuild?

After a menu rebuild, such as one that occurs automatically when visiting the Modules admin page, some of my Drupal JS behaviors are not in the correct state. I need to re-initialize or attach them ...
0
votes
0answers
27 views

AJAX in callback function

I'm trying to convert old code written in standard HTML/PHP/Javascript/JQuery into a format (more) consistent with Drupal. The code consists of a form with interactive elements (regulated by ...
0
votes
0answers
42 views

How do I make webform submissions available to Rules and loop

I have a webform application: five (5) questions/statements (Select Yes/No) for anonymous user usage. First result: all five (5) questions are answered "Yes" - the webform gets submitted, emails get ...
0
votes
1answer
68 views

Can Drush 9 be used with this core version?

I have a Drupal 7 site that was not built with Composer. I have been using Drush 7 with it, but about a week ago, drush wd-show --tail stopped working, I'm not getting any output. I installed Drush 9, ...
0
votes
0answers
10 views

maintenance-page.tpl.php is replaced per page--node.tpl.php

My template maintenance-page.tpl.php or the default maintenance-page.tpl.php is replaced per the page--node.tpl.php of my theme. I have check in my setting.php $conf['maintenance_theme'] = 'Mytheme';...
0
votes
0answers
20 views

How to add orderby field values into view_query_alter?

I have field_collection_item view, where I am passing multiple arguments using contextual filter. It is giving me result sorted by item_id, i haven't added any sort criteria but I wanted result as per ...
0
votes
1answer
28 views

Link module output with content type

I am confused on how to output links from a content type into a list in HTML. Currently I have the following code. <div class="lenders-block-content clearfix"> <ul> <?...
0
votes
1answer
14 views

How to join the `field_data_field_*` tables with `node` table using SQL?

I apologize if I ask for something obvious, but I am asking because I could not find a simple answer anywhere. I know how to work with these tables in the PHP Drupal code, which built-in functions to ...
1
vote
0answers
75 views

After saving entity bundle, entity_get_info('node') missing 'token type' property

After saving any entity bundle, e.g. node type on admin/structure/types/manage/node-type page, node 'token type' is gone: $info = entity_get_info('node'); // isset($info['token type'])) == FALSE ...
0
votes
0answers
12 views

Redis server hang up when I update drupal

I´m not sure if this is the right place to put this question. I hope it be. I have an apache server with Redis and several Drupal 7 websites that uses Redis as cache backend. It works very good and ...
0
votes
1answer
9 views

Errors when attempting to load Salesforce object from mapping admin page

We are attempting to push a content type from our Drupal site to a Salesforce object. We have successfully authorized the link between them. When we attempt to start the mapping, we get an AJAX error. ...
0
votes
1answer
34 views

How can i add text custom field on product detail page?

I want to add custom text field on product details page Where user enter some text . Which text will be shown on cart and checkout page. I have added the text field on product but it is not saving ....
0
votes
0answers
11 views

How do I programmatically sort table fields using hook_views_default_views()?

I have created all of the view configurations and exported the views_default.inc. After I re-imported my custom module the sorting table fields isn't working and needed to be configured manually again....
0
votes
1answer
34 views

Performance for file serving and storage [closed]

I intend to allow users to upload images to my website, but I'm concerned that Drupal's default handling of files might not be cut out for storing and serving potentially thousands of files without ...
1
vote
2answers
128 views

How can I conditionally alter search API relevance score?

I must be missing some core concept of search API somehow, but I am stuck. The goal is to alter search API results depending on a flag, like Give flagged products in search API a higher search score? ...
1
vote
1answer
24 views

Undefined index: und on .tpl.php for content type

How can i fix the error message? the error message is Notice: Undefined index: und in include() (line 9 of /var/www/html/sites/all/modules/custom/theme/icons.tpl.php). my code is: <?php ...
1
vote
2answers
41 views

How do I let non-admin user approve comments?

I'm looking for a way to allow a non-admin user to approve comments. I thought a Flag/Rules combination might be a solution but I can't figure it out. I added a content-moderator role, then I ...
0
votes
1answer
23 views

How to change order currency in cart/checkout page?

I want to change the price of the order in the cart/checkout page. Let's say I have a product ABC with $100(USD) and I added that in cart. But after adding I want to change the currency to EUR and ...
1
vote
1answer
36 views

Why is the jquery_update module not supporting the latest jQuery version?

The recommended jquery_update module only supports 1.10. Why recent jQuery security version 3.4.1 not updated? https://jquery.com/download/ So is it recommended to make my Drupal site to update with ...
0
votes
1answer
24 views

How can I pass parameters to a Services endpoint?

I have installed Drupal 7 and enabled Services in it. I have also created an endpoint /api/v2/ and in resources, I have allowed nodes to be listed as JSON. I have sent a GET request using browser or ...
0
votes
1answer
22 views

Get data from remote REST API (read only)

We use a remote service (not Drupal) to publish press releases and to show those releases in a remote newsroom. This remote service offers an API so we should be able to fetch and show the newsroom ...
0
votes
1answer
34 views

How do I skip importing a duplicate item?

I use unique field mapping, but instead of blocking the import on duplicates from CSV, it overwrites the data in Drupal and inserts the new value from the CSV file. This is the default behavior with ...
0
votes
0answers
8 views

Contextual raw value spiit

I need to take a first text before dash from an address bar to list related content. So for example, from www.aaa.com/US-NY-New-York, I would like to take US with contextual filter. I tried the Raw ...
0
votes
0answers
9 views

How to access the value of another field in the same field collection from a field template file?

In Drupal 7 I've customised a file download field in a template file: field--field-downloads.tpl.php Within the same field collection (using the 'field_collection' module: https://www.drupal.org/...
0
votes
1answer
38 views

Unable to load css files using ['#attached'] or drupal_add_css

I'm attempting to attach several css files to a Drupal 7 module. All files have identical read/write/execute and owner permissions. I haven't had trouble with one of the three files but I can't get ...
0
votes
1answer
27 views

How can i add ajax callback to checkbox in drupal form?

I am using taxonomy manager module I want to add ajax callback to checkbox tree view for checkbox is checked condition but it is not working can some one please suggest me. I have modified the code ...
0
votes
1answer
38 views

Site migrated to the new server with PHP 7.2 and I can't log in

We're preparing to get our Drupal infrastructure moved from PHP 5.6 to PHP 7.2. In order to start testing, I migrated a Drupal 7.67 multi-site from our current production server to a test server ...
0
votes
0answers
23 views

How to “link” Views exposed filter (fulltext search) with Facet API block (on a specific field)?

Using Drupal 7.67, Search API, Search API Database Search, Views and Facet API. I have built a search engine page with Views and Search API (with a server linked to the Drupal database tables). Two ...
0
votes
0answers
17 views

How to fill a multi-value term reference field in a ajax callback in a node add/edit form?

The machine name of the term reference field is "field_persons", using the autocomplete_deluex widget. function zwznertags_form_alter(&$form, &$form_state, $form_id) { if($form_id == '...
0
votes
2answers
27 views

How do I get the form submitted data in a custom module? [duplicate]

I have create a webform in Drupal 7. I want to access the submitted data in a custom module. I used my_module_form_submit($form, &$form_state) but no data has been found. Please Help.
0
votes
2answers
27 views

just want to change checkbox value while submit

I am using drupal 7: $form['title']['#tree'] = TRUE; $form['title']['node_first'] = array( '#type' => 'checkboxes', '#options' => array( 'value' => $value->title, ), )...
0
votes
0answers
43 views

How can I block bots after a number of failed Captcha attempts?

I am seeing hundreds of daily spam submissions that try to bypass Drupal Captcha module. I am already using honeypot contrib module, keyword blacklisting (rules) and I have added quite a number of IP ...
0
votes
0answers
34 views

D7: user_check_password() returns false but password didn't change

We've been having quite an unusual issue with Drupal: at seemingly random times it decides the password hashes for all users are invalid, and they have to do a password reset to be able to log back in ...
0
votes
0answers
14 views

Proper way to *define* new menu status code for a custom module

What would be the proper way to define a new menu status code inside a custom module? I'm developing a module where a user can add family members which can register for events. In the same spirit as ...
0
votes
0answers
13 views

Acess denied to files set as permanent in tmp folder

I made a module that saves custom files in the tmp folder when users add a product to the cart, and move the file to private folder when the order is submitted. If I set the file status to 0, users ...
0
votes
0answers
12 views

What is the best way to create uneven grids

I have a a 2-column grid view. They are equally sized but I thought that it would be nice to make one of them 1/3 and other 2/3 on each row. Just like in the example image. What would be the best way ...
0
votes
1answer
16 views

How to generate my own patches to update core for security when fuerstnet.de's “Drupal upgrade the easy way” page is out of date?

For Drupal 7, under the current host I'm using (which doesn't provide things like drush), I've found that patching is the easiest approach to updating core. However, the commonly-referenced page which ...
0
votes
0answers
46 views

How to alter data set up to be alterable by drupal_alter()?

The User Import project has an array named $supported. It also provides the following hook to alter this array: // hook to add functions to this array. // Will call all modules implementing ...
0
votes
0answers
26 views

Can file_copy() copy files between 2 folders in the same S3 bucket?

I need to copy images from one S3 folder to another S3 folder. Can file_copy() do that, or do I have to look into other ways to achieve this?
0
votes
0answers
36 views

PDOException: SQLSTATE[42000]: Syntax error or access violation: 1074 Column length too big

I am trying to update my database collations to utf8mb4 to support more characters (like emojis etc.) following this guide: https://www.jeffgeerling.com/blog/2016/getting-emoji-and-multibyte-...
0
votes
1answer
29 views

Remove a contextual filter programmatically

Is there a way to programmatically remove a contextual filter from a view? I have a view where, at times, I want to display it without the contextual filter active. This is the code I tried. ...
0
votes
0answers
13 views

Drush migration argument for xml source

I asked this question a while back and it was answered correctly and helpfully. However, I'm currently looking for a different solution. I need a way to create a custom argument which I can use to ...
0
votes
1answer
25 views

Migration of field_collection with migration_d2d

In D7 to D7 migrations, when it comes to field_collections I know “ Your field collection migration should be run after the host entity migration. ”. I have done my host entity migration via the ...
0
votes
1answer
17 views

Building views relationship with location

I have an article and food content types. I use location module fields in both content types. So for example, when I write an article about restaurants in New York, I choose article's location as ...
0
votes
0answers
8 views

Sort views results by context

Background I have a global site search powered by Search API and Solr. This site search returns a mix of multiple content and file types. Some of these content types have a region taxonomy. Content ...
1
vote
1answer
22 views

Are changes to the user status stored somewhere?

I've made a pretty serious error of judgement creating a view for a client that shows users created before a date AND still active. The error was adding a date filter. This was meant to be used at ...
0
votes
1answer
27 views

Adding a script to certain pages

I am trying to add a script code on all but few pages. I tried the following code on the template.php bfile, but it doesn't work. function THEME_preprocess_page(&$variables) { if (isset($...
-1
votes
1answer
35 views

Drupal maintenance over several environments [closed]

I have a production environment for a Drupal 7 site. This environment is replicated to a staging environment, which we use for testing updates to modules and drupal core (same major version). We ...
0
votes
2answers
42 views

Views callback work only once with advanced form block

this code work but the views is callback only once (reload only once), any idea to reload more than one time ? see in detail on drupal.org function modulename_form_alter (&$form, &$...