Drupal 7

Blog posts related to Drupal 7.

Sorting by Taxonomy Terms in Views

Have you ever had to sort a view of nodes by a referenced taxonomy term?  In our system, each staff member is entered as a separate node, containing the staff member's name, position and email address, and also containing the department the staff member works in.  The department is a taxonomy reference field.  We then have a view that pulls in each staff member's node, organized by department, and the departments are listed alphabetically.

Tags

Drupal tightens up node_load()

The other day we had an error on our Drupal 7 site where users would receive error messages whenever they tried to register for a conference. The site would register them, but the only thing the user would see is a JavaScript dialog box with an AJAX callback error message with some code in it; since the users didn't know that the site had registered them, they kept clicking the register button, getting registered multiple times. Not a desirable state of affairs.

Tags

Loading Form Definition Include Files in Drupal 7

This post was written 06/12/2015 and was migrated over from my Drupal 7 site, which is now offline.  Because of that, certain demonstrations in this post may not be functional.

Recently I had to include a form within an existing set of nodes (using hook_node_view), and this form had to make an AJAX callback. I put the form definition and Ajax callback function in a separate file for convenience. From my_ajax_test.module:

Tags