Questions tagged [7]

Version tag to tag issues specifically related to Drupal 7.x. Please note that 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
0
votes
1answer
363 views

Block showing Parent Taxonomy Term of current Node

Ok my taxonomy is setup like this: Holiday Cards Trees Bears Religious So the goal is to display a node belonging to 'Trees' but in that node I need to have a block that shows the Parent Item of '...
0
votes
1answer
782 views

Conflict between ajax callback and jQuery UI dialog

I have a button that triggers an AJAX callback with the form api like so : $form['show_modal'] = array( '#type' => 'submit', '#value' => t('Some crazy text'), '#ajax' => array( '...
0
votes
2answers
356 views

Delayed error messages for webform blocks in template

I am printing a webform block in my node.tpl.php: <?php $block = module_invoke('webform', 'block_view', 'client-block-72'); print render($block['content']); ?> And when I ...
0
votes
1answer
344 views

How to make form update/rebuild every page load?

Part of my custom form that gathers petition signatures includes some markup saying "last signer: Bob, 3 minutes ago", looked up from a database. But if the user does not submit the form, eg they ...
0
votes
1answer
790 views

Custom module Pager does not work with Ajax filter

My custom module uses an Ajax enabled drop down to allow users to filter images. There is also a pager attached to the query. The pager works fine when all the data is displayed i.e. no filter applied ...
2
votes
2answers
326 views

Views to display nodes based on ACL permission

I'm trying to use Flexiaccess with ACL to build a view based on node that the user has access granted by Flexiaccess. I found this on Drupal.org, it's the same use case, but is not working for me ...
5
votes
2answers
2k views

Displaying the contents of a document file (doc, docx, etc.)

I'm looking for a way to display the contents of an uploaded document file such as a .docx file. In Drupal 6 I used the iPaper module which did the trick as all I needed was api code to connect ...
0
votes
0answers
21 views

How can I read uploaded CSV file data and create nodes from it?

I have created custom module. but don't know how to read uploaded file data and add into perticular content type. HTML File upload is displayed but after upload file unable to read content. function ...
2
votes
2answers
61 views

Automatically creating an organic group for each new user

I would like to automatically create an organic group for each newly registered user. I checked all its settings, no such option with organic groups module, then I checked the rules module but no luck ...
1
vote
1answer
395 views

How to print the raw value of a custom user field in comments

I want to print a custom user field of the commenters. It is an Link field (https://www.drupal.org/project/link). Some users have that field completed and other not. I've read a lot of posts related ...
0
votes
0answers
15 views

db_select with groupBy(CAST(column as DATE))

I am looking to achieve GROUP BY CAST(date_time AS DATE) in a db_select function in Drupal 7 but with no idea how. The function up until now is: foreach ($distinct_users as $user){ $day_record =...
2
votes
2answers
1k views

How do I add a custom field token to a default value?

I want to add node-field data into the web from block via tokes as with Webform 7.x-4.1 this should work. But tokens from custom fields are not available in a webform(block) ? [node:title] and [...
0
votes
0answers
15 views

How do I retrieve the individual elements that make up an entity?

I have some entities (called media_item) that each consist of a collection of images (small, medium, large). I would like to pro grammatically select the large image path from one of these entities ...
2
votes
2answers
227 views

How can I make the coupon code field in commerce mandatory?

Using D7 commerce coupon/discount modules. I need to make the coupon field mandatory. Every order needs a coupon code entered. There is no standard "required" checkbox on the field and I tried using ...
0
votes
1answer
734 views

Views contextual filters taxonomy name 2 fields using same vocabulary

I have a content where two fields using the same vocabulary. I want to show nodes related content filtered by the these fields. I try with relation Relationships content:field_1 (term from ...
1
vote
1answer
387 views

Pre-Populating a Form Field with something other than its default value

I'm having a strange problem. I am constructing a form with checkboxes to toggle email subscription preferences on and off. For the new user sign-up form, this is straightforward: $form['marketing-...
1
vote
1answer
508 views

Display parent term based on child term in views

I have a vocabulary with the following structure: Vocabulary Parent term 1 Child term 1.1 Child term 1.1.1 Child term 1.2 Child term 1.2.1 Parent term 2 Child term 2.1 ...
0
votes
0answers
42 views

Strange AJAX HTTP error, 302 redirect error after update and migration

I have a Drupal 7 site (ver 7.67) running on CloudWays, PHP 7.1, MySQL 5.5. I get the AJAX error "An AJAX HTTP error occurred. HTTP Result Code: 302" The debugging information is limited: "Path: /...
0
votes
1answer
445 views

How can I set the upload destination of user pictures to Amazon?

I have installed amazon s3 module. In all the image fields of content types >> field settings I get an option to specify the upload destination Upload destination Amazon S3 Public files But ...
2
votes
3answers
1k views

How to make a page the home page of another domain

I have some pages with urls like this: http://example.com/landing/abcd http://example.com/landing/efgh as menu items: $items['landing/%'] = array( 'title' => 'Landing page', ...
0
votes
0answers
14 views

How to catch exception if the destination mail id does not exist while sending mail through webform?

I'm sending mails on submission of a webform. The destination mail address is fetched from a custom email field in the form. On submitting, when the user enters a mail address, a custom mail would be ...
3
votes
4answers
2k views

How do I check if the form is an add/edit/delete form?

I need to check if the form is for creating, editing, or deleting a node. Currently, the below snippet allows me to check if the form is for adding or editing a node. How do I check if the form is ...
0
votes
1answer
466 views

Pass multiple sets of variables to theme function

If I want to loop through multiple sets of theme variables in my custom theme template, how do I define them in my theme function and pass them to hook_theme? For instance, in my case, I'm generating ...
3
votes
3answers
581 views

Views: Filter if Value of a field equals logged in user display name?

How to do I create a filter on my view that filters based on the value of one field being equal to the name of the currently logged in user? The field is static.
0
votes
2answers
332 views

field_get_items / value when creating new content

I think I am about to lose my mind .. how in earths name do I get the value of a field in a widget during creation? I created a custom field widget, and during creation of new content I want to be ...
1
vote
2answers
332 views

Update command won't work for multisites

I have a Drupal 7 site with a half-dozen multisites/subsites and I am trying to setup Drush so that I can run my modules updates from the command line for the subsites. Running Drush for the main site ...
1
vote
1answer
801 views

how to display an image in theme using img tag?

I need to display an image in the page footer using <img> tag. In my page.tpl.php I have following block: <div id="copyright"> <img src="../images/logo.png"> <p class="...
0
votes
1answer
350 views

How to send email invite user fill in webform automatically?

I'm using drupal 7, and had a seminar questionnaire form created using webform. I would like to invite seminar attendee to fill in this questionnaire after they attend the seminar, by sending them ...
0
votes
1answer
792 views

searching and entity references

I have two content types documents and authors. When creating a document a selection list of entity reference's to authors is used to select the author. Searches for the author name find the correct ...
1
vote
1answer
1k views

Redisplay Captcha on form error in Ajax form submit

I have a Fancybox form and the form is sent via Ajax. I know that there is the error about "reuse attack" for Captcha, but this is not my case. When I wrong the form (some required fields missing) I ...
0
votes
1answer
430 views

Preview is not showing after upload

When i am trying to upload image as a Authenticate user, After upload i am not able to see preview. fields got disappear fully. If i try to do as a admin, i am able to see that. Any suggestions?
1
vote
1answer
474 views

Creating multiple URL aliases for the same node with their own context

I want to solve the following problem with Drupal 7 solely using existing modules and without any extra code. I have a contenttype called 'News' I create a news item and assign a taxonomy term called ...
3
votes
1answer
363 views

How to pull pictures and summary information from external web pages when posting links?

When posting a link (external web page) to my Drupal blog, is there a way to have Drupal automatically pull the picture and summary information from that link and include it in the post on my Drupal ...
1
vote
1answer
330 views

How to wrap / manipulate element outputs on a form's checkboxes html?

I have the following form that contains a big list of checkboxes. The first checkbox is the parent of the children below it. In my case it is called "Africa" and the ones below it are "Africa-child" ...
1
vote
0answers
70 views

Why would redirected files create 404's at website's root? [closed]

When my Drupal 7 site was built (not by me), there was a schematic file field created within our "Tool" nodes to upload tool schematics PDF files with the file directory set to sites/default/files/...
0
votes
1answer
343 views

Warning: Invalid argument supplied for foreach() in form_select_options() (line 2837 of includes/form.inc)

I get the following erros on selecting the selectbox. Here onchang of this field will populate another checkbox with city details id zipcode using ajax callback. $zipcode_options = ...
0
votes
1answer
349 views

Display order of entity reference fields

I have an entity reference field which references and displays multiple nodes on a Drupal 7 install. I am trying to get them to display in date order (the date is a field on the referenced nodes). ...
0
votes
2answers
381 views

Updating node field value using custom module validation

I currently have a custom module which calls a submit custom validation function. I am trying to update a value after the validation is run. Basically, if a value is present, update a field to say "...
0
votes
1answer
357 views

Generate unique ID in hook_redirect_form

I'm trying to write custom payment method for a custom bank gateway (off-site method). bank service expect me to send unique ID for each pay request per bpPayRequest() call. currently I sending $...
0
votes
0answers
24 views

Drupal 7 WYSIWYG module with CKeditor library stripping form and input HTML tags when inserted into a block

I'm wanting to add some code snippets from MailChimp. We are using the WYSIWYG module (7.x-2.5) with the CKeditor library version (4.9.2.9). When I add the code to a block it is stripping out when ...
1
vote
1answer
474 views

Upgraded to 7.31 but getting “no pending updates” message

After copying over the files for 7.31 (was 7.26), minus the /sites folder, and running update.php, the result is "no pending updates." I followed the instructions at https://www.drupal.org/node/...
3
votes
2answers
809 views

How to scan a directory to list all sub folders not files

I have a folder (root folder) with thousands of sub folders and *.json files inside sub folders. How can I get list of sub folder names inside folder (root folder) using file_scan_directory?
7
votes
3answers
5k views

Prevent users from editing or viewing their own profile

What is the best way to disable access to the user's profile for viewing and editing? Basically users can create an account but won't be able to edit or view their own or other users' profiles.
2
votes
1answer
406 views

Displaying Webforms on Content Types in Page Manager/Panels

The Webform module allows for a webform to be attached to each Content Type of the site. I can "Enable webform functionality" on my Page and Blog Content types and don't need to use a separate "...
1
vote
2answers
334 views

How to display registration form fields based on the taxonomy term?

I have three taxonomy terms. And I want to display different fields in the registration form based on the taxonomy term. I want something like this. taxonomy term 1: Registration form fields: Name, ...
1
vote
2answers
1k views

How do I create a TEXT column?

I am trying to create a TEXT column. function _mymodule_installed_fields() { return array( 'mymodule_summary' => array( 'field_name' => 'mymodule_summary', 'label' => $t('...
1
vote
0answers
26 views

Where do you set node revision permissions?

I’m using Drupal 7. I created a Content Type called ItemRequests. One of the fields is a Body field. As my authenticated users keep editing this Body field at different times, I want them to be able ...
1
vote
1answer
475 views

How to make a chart in Views with date as x-axis (using the charts module)?

I want to make a simple view using the Charts module. The x-axis will be a custom field of type Date that I want to show in Y-m-d format and grouped by the same date. The y-axis will be NID with ...
0
votes
3answers
425 views

Custom DOM placement using AJAX

I'm using unlimited image upload option in my content type. Upload image and remove the uploaded image options are working fine with the unlimited option. Usually, the uploaded images will be ...
0
votes
1answer
333 views

Can't create or edit content type

I cannot add new or edit existing content types. This is a drupal 7 site. I keep getting the error: The website encountered an unexpected error. Please try again later. The log returns: TYPE ...