Hooks are PHP functions used to interact with the Drupal API.

learn more… | top users | synonyms (1)

0
votes
0answers
32 views

hook_menu stopped updating the menu system on rebuild [on hold]

For some reason hook_menu has stopped updating the menu for any singular input tried. I can't really see any particular reason why it is not presently working. We've put a watchdog function inside, ...
-2
votes
0answers
25 views

Drupal Dynamic Select options for Webform

I am trying to select data from database through the following code but the data not showing when I clicking the class name in dropdown box function _webform_options_info() { $items = array(); ...
0
votes
0answers
13 views

Drupal Commerce: How to set Delivery charge depends on user billing address taxonomy term 'Area'?

I am using commerce_marketplace for handling multiple stores and i am trying to set delivery rate based on user billing address area taxonomy reference field on checkout. In my each store I need ...
0
votes
1answer
21 views

Running code only once when building a form

I have built a form using the field API. The function hook_field_widget_form gets called for every field. I have a bit of code that populates a select box but it is being called for every field in the ...
0
votes
1answer
23 views

How to add page argument in hook_menu for dynamic callback function?

I'm using groups for my website and I would like to create functions that will work for every group. I've created a tab configuration for every group like this. $groups = ...
0
votes
1answer
20 views

How can I redirect a user after adding a node that also added a new taxonomy term?

I have a content type with a Taxonomy for locations, these locations can be placed inside parent locations (f.ex United Kingdom -> England -> London), and it is set-up such that the end user can add ...
0
votes
2answers
45 views

How to create new field type

I'd like to create a new field type that can be attached to content (ie an article) via the admin interface through 'manage fields' of the content type. I am unsure of the process and required hooks ...
0
votes
1answer
14 views

menu callback path construction

It seems there is hardly any documentation on page call backs using URLS This being the case I have 2 questions: What is a legal callback path? and what becomes the URL to access that path? Here is ...
0
votes
0answers
6 views

Extending FeedAPI parser

Is there a way to extend the default parsers(or any) of the FeedAPI module? The parsers are implemented as separate modules (sub modules). So writing another parser is also a real headache (as ...
0
votes
0answers
26 views

node.tpl.php is not getting picked

I have a content type called news, I wanted to create a custom template for it because I had to embed a view just before the title. I created node--news.tpl.php and placed it in templates folder but ...
5
votes
2answers
145 views

Best way to delete all variables when uninstalling module

I'm writing a module that writes several variables (three, four variables for every content type, and other). Which method should I use to delete them on hook_uninstall? Is it safe to perform a ...
0
votes
0answers
20 views

change node types file fields widgets programatically?

I have installed multi_upload_filefield_widget. I would like to change every file widget of every file type fields of every node type programatically. i would need to automate this change since i ...
0
votes
3answers
48 views

Automating module activation during installation of Drupal

I want to add some modules in an installation profile, so that they are automatically installed during installation. Some modules need to be configured before using them. Is it possible to do it?
0
votes
1answer
8 views

Allow users to view others contents with autocomplete Entity Reference field

I'm trying to build a content type where any user can select an entity reference value through an autocompleted Entity Reference field. Using this field works as an admin. I'm able to see the ...
0
votes
0answers
12 views

cURL hangs the hook_user_update

I am using a cURL to notify remote site of some updates on my site. I use it with hook_user_update() which is used when user data is saved. Problem is that it takes a lot of time to do that (maybe ...
0
votes
2answers
33 views

How to add unique identifier to each submission?

In short, I am trying to figure out how to add a custom and unique identifier to each submission from the Webform module. Example: User fills out the Webform and submits. User then receives an email ...
0
votes
1answer
34 views

how to save a field created by using hooks in database

I added fields mobile no,landline no, using the below code to the form which i created with webform module. when i fill the fields along with two added fields and submit them .i cannot find the two ...
2
votes
1answer
61 views

Charts module settings per chart (with views integration)

(Drupal 7, Charts module, Views module) I'm creating charts with charts module + views. I want to set options for only some charts and found that in charts.api.php: /** * Alter an individual chart ...
0
votes
1answer
39 views

How would I clear values in ajax loaded select options?

http://pastebin.com/TX2UiJGZ I have 3 select drop-downs, selecting a value in the first populates the second using ajax, selecting the second populates the third. However when I change the value of ...
2
votes
2answers
32 views

Use feature as module?

Does anyone have experience with using a feature as a module? The usage I am talking about is strictly placing hooks inside the .module file. Can that trigger any sort of bug?
0
votes
1answer
21 views

Add Meta tags and Title on hook_menu “page callback”

How to add Meta and Title tags to the document head on hook_menu "page callback"? Drupal 7 Thanks!
-1
votes
1answer
54 views

Why are all Drupal mails going to spam folder wheter it is reset password mail, account activation e-mail etc.? [closed]

All the e-mails from my site are going but they are going to spam folder, whether its the Drupal system generated mails like reset password mail, account activation mail etc. How can I prevent that?
3
votes
2answers
45 views

How to wrap field out put in custom markup?

Situation I have a custom module that is using hook_field_formatter_info() to add an "fancy" option to the image field in the manage display of a content type. When this option is chosen I want to be ...
0
votes
1answer
32 views

Views custom field select list like views custom field

I'm looking for a module which can allow to add a select list like views customfield provides a text field. The select list are on the based of above fields. Example : I have Edit and delete ...
0
votes
0answers
25 views

How to restrict apachesolr search results by user/article facets

I have a wiki built with drupal, with a taxonomy category Workgroup, assigned to both the users and the articles. I am using apache solr search module with facet api and my end goal is to set up the ...
0
votes
1answer
27 views

Load certain modules only if user is administrator

I have a number of custom admin modules that deal with site statistics, site management, etc. These are quite heavy and I would like to reduce the site footprint for non-admin users. Is there anyway ...
0
votes
2answers
22 views

how to unset admin menu links programmatically?

how to unset admin menu links programmatically ? I have created a module with this hook in it function myModuleName_menu_link_alter(&$item) { // dpm($item['link_path']); ...
2
votes
1answer
109 views

Drupal + Solr, how to boost search results with updated date?

I'm trying to boost search results to give more relevancy to newly updated / created content. What I have tried is to use the following: /** * Implementation of hook search_api_solr_query_alter */ ...
1
vote
1answer
20 views

In nodereference field of a content type, Is it possible to show the content type name added with the autocomplete results?

In nodereference field of a content type, Is it possible to show the content type name added with the autocomplete results ? Example : I have a content type named Article which has a node reference ...
0
votes
0answers
11 views

Override login form submisssion

I try to call a SOAP web service before an users authentication. I've try this function beneficiaire_user_login(&$edit, $account){ die('hello from login override'); } Unfortunately, if my ...
0
votes
1answer
21 views

Change layout of views page based on taxonomy term field

I have a taxonomy term page being displayed via a Views 'page' display. I need to change a value in the header of the site (above the level of the view) based on the value of one of the fields in the ...
0
votes
0answers
30 views

How to set up webhooks with the Mailchimp module

I just installed the newest version of the MC module into my D7 instance and was wondering how I can enable webhooks for the lists that I have within the lists tab. I have already set up a test list ...
0
votes
1answer
46 views

D8. How can check is a formatter in use?

I contribute a module that provides additional formatters for the core image and link fields. To protect the module from uninstall, I need a possibility to check if a providet formatter used on a ...
0
votes
1answer
22 views

How can I use hook_comment_view?

I have added a new field to comment table, called "paragraph_id", I have also added a field to comment form that ask users which paragraph they want to put comment on and what they enter will be saved ...
0
votes
2answers
21 views

What is 'value' type of the field? [closed]

Could you please explain how it works: $form['support']['priority']['#type'] = 'value'; On my site this code is used to hide Priority field. But I don't understand the logic (I'm pretty new in ...
0
votes
2answers
25 views

How can I hide specific user from dropdown list of users

Could you please help me with one little question. I'm using Drupal module Support Ticketing System. When the support ticket is created user can choose from dropdown form for whom this ticket is ...
1
vote
1answer
29 views

Render tokens in hook_node_view

I am creating the following pseudo field in hook_node_view: function user_guides_node_view($node, $view_mode, $langcode) { $node->content['field_mytest'] = array('#markup' => '<p>This ...
0
votes
1answer
22 views

Menu is not creating in admin/settings page?

I am adding a custom module, and wants when someone install the module, menu will be added to add data in the admin/settings page... But i am getting nothing: Below is the code i wrote.. ...
0
votes
0answers
24 views

How can I change view data after the query is executed but before it's output?

I tried hook_views_pre_render but it's not acting as I would have expected. What I'm doing is taking the view data after it has been executed, looking at the result, and then changing the result. ...
0
votes
1answer
23 views

How to alter view query

I am just looking for altering select query, created by any view just before its execute. For e.g. I want to add some manual filter which I can't add from Views' UI. Thanks in advance
0
votes
0answers
35 views

entity eck create new property type or/and behaviour

I guess everyone here has done what I want multiple times and I am probably just stupid but I can't seem to find it. So in my drupal 7 installation I want to create an entity with a date property(so ...
1
vote
1answer
19 views

Calling hook_entity_view from a theme

Is there any way to call hook_entity_view() from a theme? I tried adding the implementation to the template.php file, but the function is not called. I know I can do it via custom module, but as ...
0
votes
1answer
32 views

Perform action on logout,

I would like to add javascript on logout. I tried using hook_user_logout but the javascript doesn't get added. Even adding something as simple as drupal_set_message doesn't result in a message ...
0
votes
1answer
26 views

Which hook to use in a custom module for tracking access to one particular page?

I'm probably not fully awake this morning because it seems so trivial but I cannot figure it out. I need a hook to track when user access a certain page (path = 'export-csv'). This page is not a node ...
1
vote
0answers
37 views

Help with form select options and sorting of values

I have altered the log-in form to my client's specification and I'm having problems with the display and sorting. As you can see, I have a select list called Organization. That is the Username Text ...
1
vote
1answer
130 views

Make a direct database query

Basically I want to run this query against the current database and retrieve all node titles with node type of foo_type. SELECT title FROM node WHERE type='foo_type' ORDER BY title ASC How can I do ...
0
votes
0answers
36 views

Programatically alter field label using hook_views_pre_render

I know this can be done easily using the Views UI under 'rewrite the output of this field'. But for some reason I really need it done through a custom module using hook_views_pre_render (or possibly ...
0
votes
1answer
24 views

skip processing html and page

From a module, I want to output "hello world" simply as a string as efficiently as possible when i call /mymodule/helloworld. ofcourse, using hook_preprocess_html and hook_preprocess_page i can ...
0
votes
0answers
21 views

Hook form alter, adding currency symbol to value?

I am using drupal 7 and have created a custom module to override a field value. $form['field']['#value'] = "new amount"; which works. If I want to add a currency symbol such as ...
0
votes
0answers
8 views

registration form disable required username

I'm using the logintoboggan module, so that users identify with email and password. Everything works fine, with exception of that on the registration form is required to put a user name. It must ...