drupal

Variable Check module fixes error

One of the websites I manage started to get the following notice even though I have the logging errors off:

Notice: unserialize() [function.unserialize]: Error at offset X of X bytes in variable_initialize() (line 749 of /<sitepath>/includes/bootstrap.inc).

After checking out the line in bootstrap, I realized I had some bad variable in the variable table. But I have over 800 variables in that table. How am I going to find the culprit?

Variable check module to the resue - https://www.drupal.org/project/variablecheck

Ajax Autocomplete Textfield for Nodes

function module_name_form() {
  $form = array();
 
  $form['nid'] = array(
    '#title' => t('Nodes'),
    '#type' => 'textfield',
    '#autocomplete_path' => 'example/autocomplete',
   );
 
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => 'Save',
  );
 
  return $form;
}
function module_name_menu() {  
  $items['example/autocomplete'] = array(
    'page callback' => '_module_name_autocomplete',
    'access arguments' => array('access example autocomplete'),
    'type' => MENU_CALLBACK
  );
  return $items;
}
  

Let's all COPE

With my daily FB news updates I came across this article titled "CMSs are dead, long live CMSs".

Setting up custom styles in CKEditor with Drupal

In order to set up custom styles in the drop-down list to the CKEditor toolbar is not that difficult but the instructions here is not very well defines when you are integrating with Drupal.

Simply copy the sites/all/modules/ckeditor/ckeditor.styles.js file into your theme directory. 

Apache Solr Multi-core Setup on Tomcat

Setting up one Solr server with two or more Drupal sites takes some additional configuration. If this is not done, all of the data for each site goes into the same index and when searching on one site, results are returned from both sites. If that's not the desired result (faceting won't currently work correctly), then it is necessary to set up a separate Solr core for each site. Each core is a totally independent search index.

Drupalcon Denver

New modules to look at:

Contextual Administration

Flex Slider

The Examples modules

If you are new to developing for Drupal 7 or upgrading from another version, the examples modules is a GREAT module for examples on how to develop for Drupal using the API. It gives you the basic of a lot of the common things you do when developing. Some examples included are theming (hook_theme), running cron job (hook_cron), forms (hook_form, hook_element_info), menu, node and so much more!!

http://drupal.org/project/examples

Change button name using form_alter

<?php
/**
* Implementation of hook_form_alter().
*
* The function is named modulename_form_alter.
*/
function my_hook_module_form_alter(&$form, $form_state, $form_id) {
// Normally a switch is used because you may want to alter more than
// one form and it is easy to add a new case for each form.
switch ($form_id) {
// This is our form ID.
case 'my_new_form_node_form':
// Our kickin' mods go here.
$form['submit'] = array(
'#type' => 'submit',

Fuzetto Intranet Solution

An intranet "portal" is defined not merely by the technology platform that makes it run. When you get beyond the buzzword, a portal supports an organization and its employees by aggregating and organizing all the
information and applications that users want and need to function effectively in their jobs.