Last call to make your voice heard! Our 2022 Developer Survey closes in less than a week. Take survey.

Questions tagged [7]

Version tags should be used for questions that apply to a version only, not to merely say what version a site is using.

Filter by
Sorted by
Tagged with
21 votes
6 answers
18k views

White screen of death: Fatal error: Allowed memory size of X bytes exhausted

I have a issue with my Drupal installation, for example: when I enable or disable the modules, It redirects me to a blank page, when I create a new content type and save it, redirects me to a blank ...
user avatar
  • 791
6 votes
1 answer
2k views

What are the various roles supported by the Group module?

The Group module is an alternative for Organic Groups. For each group you can specify appropriate permissions, and this for various "roles" that are specific to the Group module (these roles are not ...
user avatar
41 votes
1 answer
6k views

Why is hook_form_alter() so messy?

Here's an example I just ran into. I'm trying to put some HTML in the label of my field. $form['field_feedback']['und']['#title'] <- has the title $form['field_feedback']['und'][0]['#title'] <- ...
user avatar
  • 2,440
2 votes
3 answers
673 views

How can I display the value of a variable inside a condition?

I have created a rule using the Rules UI. My rule is not working, and I need to debug it, displaying the values of my variables inside a condition where I make a comparison. I see within Rules ...
user avatar
  • 131
150 votes
10 answers
204k views

What are the recommended directory permissions?

I'm gearing up to deploy a Drupal 7 site and I can't find any documentation. What are the recommended security-conscious permissions for files and directories? I am specifically interested to the ...
user avatar
  • 2,119
5 votes
1 answer
3k views

What's the alternative to using the Conditional Rules module?

The Conditional Rules module allows for including Rules Conditions within Rules Actions (using its If/Else constructs), something you cannot do by only using the Rules module. Here are just a few (out ...
user avatar
40 votes
7 answers
14k views

Drupal SA-CORE-2014-005 - How to tell if my server / sites were compromised?

I just updated all my sites using the patch method of resolving the Drupal SA-CORE-2014-005 exploit. I just read reports that just yesterday there is someone from a Russian IP infiltrating drupal ...
user avatar
109 votes
2 answers
68k views

Contextual filters taxonomy name

I'm adding a contextual filter to a view for a custom content type that has a taxonomy field. The contextual filter allows me to filter by the taxonomy tag id but not by the taxonomy tag name. Meaning ...
user avatar
  • 1,233
9 votes
10 answers
10k views

Unable to send e-mail. Contact the site administrator if the problem persists

When my web form is filled and submitted, I get redirected to a page that says: Thank you for submitting. but theres a red warning box there that says: Unable to send e-mail. Contact the site ...
user avatar
  • 1,750
106 votes
1 answer
43k views

How should I implement hook_menu()?

What are the fundamentals of implementing hook_menu()? I would like to see the basics covered in a single question, to avoid having to answer the same similar but different questions over and over.
21 votes
5 answers
5k views

Is displaying a working Field Widget Form on its own possible?

I'm interested in embedding a Field Widget Form out side the context of the whole node edit form. I have displayed full forms in the past using drupal_get_form but that doesn't seem to apply for ...
user avatar
  • 946
29 votes
5 answers
57k views

Dynamic select list in the form (dependent dropdown)

I'm using Drupal seven. I want to make the options in a select list be dependent on the value chosen in another select list in a form. I'm sure this has been asked many times before, but I am having ...
user avatar
  • 980
16 votes
4 answers
14k views

Properly bootstrap drupal for standalone PHP file?

This is what I have right now: <?php define('DRUPAL_ROOT', '/var/www/clients/client1/web15/web'); include_once(DRUPAL_ROOT . '/includes/bootstrap.inc'); drupal_bootstrap(...
user avatar
  • 2,440
6 votes
1 answer
3k views

How to create a node from a Webform using rules?

I want to create a node based on a webform data using the Rules module. This is because of a complication surrounding relationships within the associated CRM system. I am already at the point where ...
user avatar
54 votes
10 answers
14k views

How do you improve Drupal performance?

Drupal is fast at develop, but the performance is so poor. It is hard to reach 50 request per second. And there are so many SQL queries in a simple web page. If you test the request time of a form ...
user avatar
  • 655
33 votes
5 answers
32k views

Node count for taxonomy terms

How can I display the node count values for taxonomy terms with sorting the result list in descending order of node count?
user avatar
  • 5,229
0 votes
1 answer
1k views

How to make the permissions of a module more granular?

Assume a (contributed) D7 module, say module ABC, comes with only a few permissions (which can be set on the typical /admin/people/permissions page). For example: Administer module ABC. Access (view) ...
user avatar
1 vote
2 answers
2k views

How to specify a Rules event like "Content is 'going to be' viewed"?

To answer the question about "How to restrict access to a node via node/12 and allow access via a path like content/sometitle?", I thought it should be possible to use the Rules module to do so. I ...
user avatar
33 votes
2 answers
62k views

Custom validation for a form?

I need to add custom validation to a form, lets says add article form. I was expecting something like hook_FORM_ID_validate() to handle this, but cannot find anything relavant in the API ...
user avatar
  • 6,037
8 votes
4 answers
6k views

PDOException when creating the table: Base table or view not found [closed]

I have Drupal running on MariaDB 5.5.33. When I run update.php (after upgrade to Drupal 7.28 from Drupal 6) I get an error: Failed: PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 ...
user avatar
  • 123
2 votes
1 answer
999 views

Rule to store user's last post date and scheduled rule based 30 day reminder

In this scenario, user's can post 1 node of a specific content type every 30 days (interval changes depending on user role). We are using node_limit to accomplish this; it's doesn't play with rules. ...
user avatar
  • 53
14 votes
5 answers
20k views

Changing url of exposed filter

When I used an exposed filter the filter selection is passed as name/value pair in the url, for example: members?field_a=valuea&field_b=valueb How can I set it up to use more of a "pathauto" ...
user avatar
  • 11.9k
7 votes
3 answers
16k views

Resolve the error "An illegal choice has been detected..."

I have written code like below and all works fine, but while submitting the form I get the error below. I am trying to filter the second dropdown based on the first drop down selection. An illegal ...
user avatar
  • 3,024
21 votes
5 answers
23k views

Image styles return Access Denied

I'm using the Insert module to allow users to insert images with a specific image style into a page. After upgrading to Drupal 7.20, the images are not stored in the files/styles folders, and the ...
user avatar
6 votes
2 answers
5k views

How to use the Rules module to implement a custom redirect for an outdated URL?

I used to show content from a catalog via the Views module, accessing an external database, so that all of the URLs would be something like /content?name=[name]. For various reasons, I've opted to ...
user avatar
  • 75
6 votes
2 answers
3k views

How to create a basic message - notifications system displaying a real time message counter badge? [closed]

I'm looking for a way to create a basic current user notifications system for my site, e.g.: "some user" has created a new "group" "some user" has joined your "group" "some user" has posted a node in ...
user avatar
  • 828
1 vote
1 answer
655 views

How to set multiple values to an unlimited Term Refence field with Rules

I have two content types: Ingredient and Recipe Sheets. Both Ingredient and Recipe Sheet have a term refence field called Allergens. Ingredient has the Allergens term reference field filled in. IE: ...
user avatar
  • 29.5k
2 votes
1 answer
313 views

Which user related token(s) can be used to create a Rule for setting up a message type?

I have created few activity logs using the Message module. All works ok, but when I try to create a message type for example "username started following you on github". When setting up the rules for ...
user avatar
  • 441
53 votes
6 answers
37k views

How can I automatically upload images on file selection rather than pressing the upload button?

I have a custom content type to allow users to upload images. I'm trying to keep the interface as simple as possible. The content type contains a single image field. This works, but some users don'...
user avatar
53 votes
19 answers
146k views

Configuring the temporary directory

I have recently moved a site from a localhost to a VPS. I have managed to make the public and private files writable; however, I am not sure where to find the temporary folder and how to change the ...
user avatar
48 votes
3 answers
30k views

How to provide template for particular view mode?

I want to theme the search result view mode with a template. I had it in my head that naming a template file node--article--search-result.tpl.php would do the trick, but I'm obviously wrong about ...
user avatar
  • 3,909
47 votes
3 answers
19k views

How to migrate from test environment to production environment?

The migration is from the local environment to the production environment. The production environment has run some time and created a lot of articles. In order to add new things to my site, I added ...
user avatar
  • 3,788
30 votes
9 answers
45k views

How do I remove duplicates when using the random sort?

I have created a view where I am displaying the the node title and a logo (a cck field). In the arguments I have passed the taxonomy term name. In the result a node is displaying 2 or 3 times; I ...
user avatar
  • 2,697
23 votes
4 answers
6k views

Clean way of building simple taxonomy browser of arbitrary depth

I have spent days trying to determine a clean way to do the following: Display a list of all top-level terms in a vocabulary with links to their child terms Upon clicking a link, be taken to a list ...
user avatar
  • 9,067
21 votes
1 answer
71k views

Strict warning: Only variables should be passed by reference

I get the following error: Strict warning: Only variables should be passed by reference in include() (line 18 of /home/sites/dev/theparce/sites/all/themes/parce/block--block--3.tpl.php). This is ...
user avatar
  • 2,786
3 votes
1 answer
2k views

How to bulk assign existing content to a group created with the Group module?

The Group module is an alternative for Organic Groups. One of the features it offers is that you can assign nodes to a Group. Question: how to bulk-assign a set of existing nodes to a specific group, ...
user avatar
58 votes
2 answers
45k views

Better understanding of Drupal behaviors

I read about Drupal behaviors today, and I tried writing the following code. (function ($) { Drupal.behaviors.mymodule = { attach: function (context, settings) { $('#mymodule_id', ...
user avatar
  • 3,024
42 votes
3 answers
50k views

how to send variable from .php file to .js file?

I hope someone is able to help me. The problem is the following one: 1)I have module in which a assign the variable in order to send to the template file php.tpl <?php ... $testvar="Hello from ...
user avatar
  • 931
77 votes
4 answers
73k views

How do I load a field collection from a node?

I have a node that has a few field collections on it. When I look at node_load() output, I see: [field_rich_text_group] => Array ( [und] => Array ( ...
user avatar
  • 3,653
49 votes
6 answers
42k views

Programmatically create a user and assign a role

I'm programmatically creating a user with the following code. $newUser = array( 'name' => $mail, 'pass' => 'password', // note: do not md5 the password 'mail' => $mail, 'status' =&...
user avatar
61 votes
8 answers
77k views

Rebuild images from image style

I have an image style in Drupal 7. I attached several images to a nodes and display the images based on this style. I then changed the effects on this image style but the existing images are not being ...
user avatar
  • 3,653
18 votes
9 answers
46k views

Create template file for views block

There is a lot about theming custom blocks, but what about blocks created by views? My views block has id: block-views-posts-listing-block, I try many ways for naming template file, ex: block--block-...
user avatar
  • 4,955
21 votes
5 answers
29k views

Show forms in a modal window [closed]

I have a form and I am using Drupal 7. I need to show this form in a popup when a user clicks a link. The user should then be able to complete the form whilst in the pop up window. I can use anything ...
user avatar
  • 3,024
12 votes
2 answers
25k views

How do I theme a webform? [closed]

I am in need to theme webform in D7. How can I do that ? In the search I've come to know that by using web-form-nid.tpl.php we are able to theme a drupal individual form. Could any one guide me in ...
user avatar
  • 1,555
2 votes
6 answers
3k views

Is there a simple way to notify users about new posts on the site?

I want my users to be able to "subscribe" to new content that is posted on my site. I've looked at the Notifications and Subscriptions modules and they are just massive! I've also looked at ...
user avatar
3 votes
1 answer
747 views

Memory Exhausted after Drush install [duplicate]

I've made a drush install of drupal 7.28 on my AWS server. I can confirm that the memory is set to 128M, all green on the reports -> site status page. The website will function normally and ...
user avatar
1 vote
1 answer
393 views

How to show message view containing own and following activity?

I have created a message view using the Message module. I want this view to show the current user activity and activity of the user he is following using the "follow" flag (user). i.e own + following. ...
user avatar
  • 441
81 votes
12 answers
54k views

Any way to add CSS for a single page/node?

I'm cleaning up my big crazy style sheets (possibly pertinent to a future question) and I'm wondering the best way to add custom CSS to a specific node or page. In particular, my work site's home page ...
user avatar
  • 1,290
63 votes
6 answers
70k views

Print the query which is built using db_select()

I want to print the query which is built using db_select() in a programmatical way. Is there any API function provided by Drupal Abstraction Layer? It is similar to query output in Views, but I want ...
user avatar
  • 4,913
40 votes
9 answers
32k views

Count of nodes by type [closed]

I am looking for a snippet that lets me display the total count for a specific node type, e.g. "Pages = 167" or "Products = 10630." What code should I use to achieve this?
user avatar
  • 565

1
2 3 4 5
59