All Questions

Filter by
Sorted by
Tagged with
95
votes
7answers
14k views

What are the downsides of using PHP Filter code in blocks, nodes, views-args, etc?

I have seen many times people saying not to use custom PHP/PHP filter (from the Drupal UI) in blocks, nodes, views-args, rules, etc. I have searched around a bit and haven't found much, it seems like ...
20
votes
6answers
17k 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 ...
6
votes
1answer
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 ...
25
votes
4answers
15k views

Database general error: 2006 MySQL server has gone away

Recently I started getting an error every time I try and add a content no matter what type. This is the error that shows up in the browser: Additional uncaught exception thrown while handling ...
39
votes
1answer
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'] <- ...
2
votes
3answers
608 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 ...
4
votes
5answers
607 views

How to stop a Views block from displaying to administrators, such as user/1?

I created a view and put an access role of anonymous user. When I log in with normal user account I don't see it, but when I log in with my admin account I see the view. I would like to not see it. ...
147
votes
11answers
191k views

What are the recommended directory permissions?

I'm gearing up to deploy a Drupal 7 site and I can't find any documentation about what the recommended security-conscious file and directory permissions should be set to. Specifically default/files/ (...
5
votes
1answer
2k 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 ...
34
votes
5answers
74k views

How do I get the raw field value in a twig template?

myfield is a plain text field. {{ content.field_myfield }} renders the field with HTML markup and the field label. How do I render the raw value of the field? {{ content.field_myfield.value }} doesn'...
40
votes
7answers
13k 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 ...
25
votes
7answers
21k views

How to see the error messages when I get the white screen of death?

How can I see the error messages when the site I am working on gets a white screen?
8
votes
10answers
7k 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 ...
105
votes
2answers
67k 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 ...
35
votes
9answers
62k views

How can I programmatically display a block?

I'm developing a site using Drupal 8 beta-14. I've created a view block of different terms and now I want to display it using code. How can I display it programatically? I used to do it in Drupal 7 ...
120
votes
14answers
17k views

What is the basic concept behind hooks?

I am intermediate in PHP. To polish my skills I start learning Drupal 7. While learning Drupal architecture concepts, the terms hooks and bootstrapping puzzled me a lot. I read the "Pro Drupal ...
56
votes
2answers
21k views
103
votes
1answer
41k 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
5answers
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 ...
5
votes
3answers
1k views

How to restrict access to a node via node/12 and allow access via a path like content/sometitle?

Problem: I want to restrict direct node access using node number www.example.com/node/12 and allow access using pathauto alias www.example.com/content/sometitle to anonymous user. This user should be ...
29
votes
5answers
56k 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 ...
49
votes
13answers
20k views

How do I hide nodes that shouldn't be directly accessed from users and search engines?

I've found that there are times I have a node that simply contains content that will be displayed somewhere else, but shouldn't be viewed directly. That is, no one should ever go to node/1234, but the ...
16
votes
4answers
13k 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(...
8
votes
2answers
5k views

What are the features of the Group module versus Organic Group module?

To create groups in Drupal we have at this moment the Group module and the Organic Groups module. From the Group module page: The Group module allows you to create arbitrary collections of your ...
5
votes
1answer
2k 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 ...
54
votes
10answers
12k 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 ...
6
votes
4answers
2k views

How to prevent a node being saved when using the Rules module?

Is it possible to prevent a node from being saved with Rules? This is what I do now: Create a rule Before saving content of type ''. Condition: IF ... TRUE => Redirect & set message Create a ...
33
votes
5answers
31k views

Views and node count for taxonomy terms

How can I display the node count values for taxonomy terms in Views? with sorting the result list in descending order of node count.
26
votes
5answers
20k views

Using OR with EntityFieldQuery

I have never had the need to do this before today, but it doesn't seem like you can make OR queries with EntityFieldQuery, since db_or is used for select queries. An example would get to all entities ...
15
votes
2answers
33k views

How do I apply a patch file? [closed]

I downloaded a patch file from mailhandler module and need to apply the changes in order to fix the problem of pop3 accounts not deleting emails after download (import). How do I install it?
16
votes
6answers
3k views

Why don't we hack core?

I couldn't believe that this question hasn't already been answered on this site, but I didn't find it when I searched, so... Why is it such a bad idea crime against nature to hack core? Is it really ...
0
votes
1answer
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) ...
6
votes
1answer
2k views

How can I compare data comparison with values submitted in a webform?

I am trying to use webforms with the Rules module. How can I compare data with the values submitted in a webform ? For example, if the webform has a yes/no radio button, how can check the submitted ...
33
votes
4answers
43k views

How do I update jQuery to the latest version I can download?

I'm using Drupal 7, which uses jQuery 1.4 as default? How can I update it to the latest version (currently 1.7)?
30
votes
2answers
57k 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 ...
8
votes
4answers
4k 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 ...
2
votes
1answer
941 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. ...
1
vote
2answers
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 ...
49
votes
7answers
61k views

How to a use a template file to theme a form?

While nodes, comments, blocks and many other things in Drupal are themed using theme template files (like node.tpl.php), forms are a different story. There are no theme template files for forms. How ...
42
votes
14answers
33k views

How do I remove a configuration object from the active configuration?

I'm writing a custom module for Drupal 8. It defines a field storage configuration object, in a file called modules/mymod/config/install/field.storage.bloom_stem.bs_twitter_ac.yml. The problem is ...
38
votes
9answers
64k views

How to get the valid URL of a Link field from within a Twig template?

I have a Link field named field_my_link (machine name). Within a Twig template I can get the link's URL value with this: {{ node.field_my_link.uri }} If inside the Link's URL there is an external ...
15
votes
3answers
19k views

How can I implement AJAX form submission?

My task is to submit contact form via AJAX and then to show "Thank you for submission!" message, loaded in place where the form was. So I need to ajaxify existing contact form. I found some examples ...
7
votes
3answers
14k 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 ...
27
votes
3answers
44k views

Programatically render a block in a twig template

I need to render a views block in my page.html.twig template. In D7 I would do this: <?php $block = module_invoke('module_name', 'block_view', 'block_delta'); print render($block['content']); ?...
15
votes
5answers
19k 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" ...
26
votes
5answers
36k views

Easy way to create blocks programmatically? [closed]

Learning Drupal. I know now that I can create block through the backend, but I would rather precreate them programmatically, if it's possible. In fact I'm pretty sure that it's possible. But what's ...
7
votes
2answers
5k views

Change a normal submit 'input' type to 'button' type with button tag

Is it possible in Drupal 8 to change a regular form submit button from Drupal into a button tag? This is the output I need to achieve: <button type="button" class="search-box__button"> <...
21
votes
5answers
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 ...
14
votes
18answers
20k views

Redirect after user login

I would like to redirect users after they log in. Is it possible to use hook_user_login() to make the redirection? How do I add the parameter for the redirection?
6
votes
2answers
4k 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 ...

15 30 50 per page
1
2 3 4 5
153