Drupal 7

Update Drupal 7 text fields max length for fields having data

Technologies: 
<?php
/*
* Utility to change the max length of a text field
*/
function change_text_field_max_length($field_name, $new_length) {
  $field_table = 'field_data_' . $field_name;
  $field_revision_table = 'field_revision_' . $field_name;
  $field_column = $field_name . '_value';

  // Alter value field length in fields table
  db_query("ALTER TABLE `{$field_table}` CHANGE `{$field_column}` `{$field_column}` VARCHAR( {$new_length} )");
  // Alter value field length in fields revision table

Actions in Views Bulk Operations

Views Bulk Operations come handy when doing bulk operations over a selected list. This is great because it combines the power of views to filter the selection and specific actions to do on each selected entity. For Ex: Updating some field in the record, deleting selected entity and so on.

Views also provide an easier way to define your own set of custom functions to perform on each selected row of entities.

First, we need to define an action :

Fixing Issue: Fatal error: "Maximum execution time of 240 seconds exceeded"

Search for drupal_set_time_limit in Drupal directory and modify the line as below. Ensure that it is restored later once the required operation is over:
For example: Modify the following line in locale.inc file in includes/locale.inc.

<?php
drupal_set_time_limit
(240);
?>

and set to 1800.

Organic Groups Views Exposed Filter Selection

It becomes very frustrating when one had to try various options but not be able to create drop down list of groups for selection via an exposed filter option in a view.

There is a very simple solution to it. In the Group Audience field settings, select "Render Views filters as select list" option under ADDITIONAL BEHAVIORS. This selection would make the Group Audience field selected as an exposed filter display drop down options of all the groups available.