Questions tagged [drupal-modules]

Drupal modules are add-ons for Drupal that allow you to extend, and customize Drupal functionality. Use this tag is for questions about available modules hosted on www.Drupal.org.

Examples of Drupal modules are Views, Token, CCK, and Pathauto.

The Project Usage Overview contains a complete list of all available modules for Drupal. This includes a ranking about the number of reported installs for each module.

Get access to all sorts of resources for any Drupal module via drupal.org.

2132 questions
40
votes
12 answers

array_flip():Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->load()

I have recently migrated my module to Drupal7 (on PHP Version 5.3.1) and now I am getting following errors: * Warning: array_flip() [function.array-flip]: Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->load() (line…
Ajinkya Kulkarni
  • 964
  • 2
  • 11
  • 19
35
votes
4 answers

Can you Create your Own Hook in Drupal?

Is it possible to create your own hook in a Drupal module for other Drupal modules to consume? If not, is there a mechanism in Drupal for third party developers to provide hooks? If everything's been a no so far, where in the core are the list of…
Alan Storm
  • 157,413
  • 86
  • 367
  • 554
22
votes
6 answers

Drupal: how to get the modules list

How to get the modules list in Drupal as in admin/build/modules?
sultan
  • 5,468
  • 12
  • 55
  • 101
18
votes
3 answers

How to disable and uninstall a Drupal module programmatically?

I want to be able to disable and then uninstall a module programmatically on my local environment and then easily push that code to prod so everything gets updated. I'm guessing it's something with the hook_update_N. But not sure where to start.
Ben Marshall
  • 1,605
  • 2
  • 16
  • 29
17
votes
4 answers

How to get the currently logged in user's role in Drupal 7?

How to get the currently logged in user's role in Drupal 7 ? Do you know a simple way of accomplish this ? Is there some drupal core functions for this?
Ek Kosmos
  • 4,050
  • 7
  • 28
  • 45
16
votes
4 answers

How to change footer Powered by Drupal and its link?

I am working on Drupal. I want to know how to change that footer text Powered by Drupal and link given to it. I want there "Copyrights 2012 (My site name).All Rights reserved." I can not getting it can any one help me.
devloper
  • 244
  • 1
  • 2
  • 10
13
votes
3 answers

Set Drupal Module Weight

When developing a custom module, what is the correct way to set a module's weight?
markdorison
  • 115,110
  • 27
  • 52
  • 69
13
votes
3 answers

Drupal Views: Display recent nodes created by user on profile page

I'm wondering how I can display the recently created nodes by a user on their profile page. I've created a new page for a user at /user/%user and I want to be able to display the latest nodes created by that user.
Conor Mongey
  • 765
  • 1
  • 5
  • 14
12
votes
5 answers

how to check if the user is in the admin part of drupal?

How do i check if the current page is in the admin section of drupal?. I want to display a login form in some pages from the main menu but the login page is displayed in the block selection menu .Please suggest a solution ..
Sreejith Sasidharan
  • 1,188
  • 5
  • 22
  • 44
10
votes
5 answers

multiple frontpages in multiple languages

I have a Drupal 7 multi-language(3) website. I have installed the Internationalization (7.x-1.0-beta2) module. I have created for each language a page, and translate it into two others languages. Now here is what I want to do: to set a kind of…
10
votes
3 answers

How to split the code of a module into separated files

I am very curious to know how a Drupal module can be dis-integrated into multiple include files. A number of hook support to link include components, like hook_menu, hook_theme etc. Once I planned to simplify one of my complex module that have…
Shoaib Nawaz
  • 2,152
  • 4
  • 28
  • 37
10
votes
3 answers

How do i push a new key value pair to an array php?

I know there is a lot of documentation around this but this one line of code took me ages to find in a 4000 line file, and I would like to get it right the first try. file_put_contents($myFile,serialize(array($email_number,$email_address))) or…
Tallboy
  • 11,480
  • 11
  • 67
  • 151
9
votes
6 answers

Programmatically getting nodes by title in Drupal 7

I have a module that programmatically adds a whole lot of nodes to my Drupal 7 site. To prevent duplicates I want to check whether the title of my newly created node doesn't already exist in the system. There will never be a case where two nodes…
Eruonen
  • 101
  • 1
  • 1
  • 3
9
votes
1 answer

Drupal: Are hook_ functions in *.api.php ever called?

In Drupal 7, every core module has a *.api.php file, where * is the name of the module. For example modules/node/node.api.php modules/path/path.api.php What are these files for? They contain functions that start with hook_, and the name of a hook…
Alan Storm
  • 157,413
  • 86
  • 367
  • 554
9
votes
5 answers

How to change Drupal user password programmatically?

We are going to deploy a Drupal site inside company's intranet. There is a requirement for user to reset password. We have a centralized password reset mechanism (for single sign on): user submits a password change request in system the request is…
ohho
  • 47,708
  • 70
  • 236
  • 372
1
2 3
99 100