Drupal – Skipping require fields errors

function hook_form_validate($form, &$form_state) {
  $errors = form_get_errors();

  if ($errors) {
    // Clear errors.
    form_clear_error();
    // Clear error messages.
    $error_messages = drupal_get_messages('error');
    // Initialize an array where removed error messages are stored.
    $removed_messages = array();

    // Remove all errors originated by the 'foo][bar' element.
    foreach ($errors as $name => $error_message) {
      if ($name == 'body][und][0][value') {
        $removed_messages[] = $error_message;
        unset($errors[$name]);
      }
    }

    // Reinstate remaining errors.
    foreach ($errors as $name => $error) {
      form_set_error($name, $error);
      // form_set_error() calls drupal_set_message(), so we have to filter out
      // these from the error messages as well.
      $removed_messages[] = $error;
    }

    // Reinstate remaining error messages (which, at this point, are messages that
    // were originated outside of the validation process).
    foreach (array_diff($error_messages['error'], $removed_messages) as $message) {
      drupal_set_message($message, 'error');
    }
  }
}

Source: http://goo.gl/nI55mb

Drupal: Basic Workbench configuration

Install and enable the following modules and their respective dependencies (Views and Chaos tools):
– Workbench
– Workbench Access
– Workbench Moderation

Edit all content types that will go through the workflow
– Under Publishing options, uncheck the following options:
– Published
– Under Publishing options, check the following options:
– Create new revision
– Enable moderation of revisions
– Enforce Workbench Access control
– Under Publishing options, make sure the Default moderation state is set to Draft

Go to permissions and check the following permissions for the Author
– View published content
– View own unpublished content
– View content revisions
– “Create new content” and “Edit own content” for all the appropriate content types
– View the administration theme
– Use the administration toolbar
– Access My Workbench
– Allow all members of this role to be assigned to Workbench Access sections
– View moderation history
– View the moderation messages on a node
– Use “My Drafts” workbench tab
– Moderate all content from Draft to Needs Review

Go to permissions and check the following permissions for Publishers
– Administer menus and menu items
– View published content
– View own unpublished content
– View content revisions
– Revert content revisions
– Delete content revisions
– “Create new content”, “Edit any content”, and “Delete any content” for all the appropriate content types
– View the administration theme
– Use the administration toolbar
– Access My Workbench
– Allow all members of this role to be assigned to Workbench Access sections
– View all unpublished content
– View moderation history
– View the moderation messages on a node
– Use “My Drafts” workbench tab
– Use “Needs Review” workbench tab
– Moderate all content from Draft to Needs Review
– Moderate all content from Needs Review to Draft
– Moderate all content from Needs Review to Published

Go to Taxonomy and add a new vocabulary. Name it “Content Workflow”
Add the following terms:
– Content Publishers
– Content Authors
– Under Relations fieldset, select Content Publishers as the parent term

Go to the Workbench Access from the admin configuration page.
Go to the Settings tab
Check the Content Workflow under the Taxonomy Scheme Settings fieldset
Under the Content Types enabled, make sure all the appropriate content types are checked

Go to Roles tab
Click the 0 roles link of Content Publishers
Check the publisher role
Click the 0 roles link of the Content Authors
Check the author tab

Go to the Workbench Moderation from the admin configuration page.
Go to Transitions tab

Basic sendmail configuration on XAMPP Windows using an Office 365 account

sendmail.ini

smtp_server=smtp.office365.com
smtp_port=587
auth_username=your-username@your-domain.com
auth_password=your-password
force_sender=your-username@your-domain.com

php.ini

SMTP=smtp.office365.com
smtp_port=587
sendmail_from = your-username@your-domain.com
sendmail_path = "\"C:\xampp\sendmail\sendmail.exe\" -t"

Source: How to configure XAMPP to send mail from localhost?

How to install wxPython 2.9.4 on Fedora

Install the dependencies

sudo yum install make automake gcc gcc-c++ kernel-devel gtk2-devel gtkglext-devel gstreamer-plugins-base-devel python-devel webkitgtk

Download the source

wget http://downloads.sourceforge.net/project/wxpython/wxPython/2.9.4.0/wxPython-src-2.9.4.0.tar.bz2
tar xvjf wxPython-src-2.9.4.0.tar.bz2

Download and apply the wxPython 2.9.4.1 patch

http://downloads.sourceforge.net/project/wxpython/wxPython/2.9.4.0/wxPython-src-2.9.4.1.patch
patch -p 0 -d wxPython-src-2.9.4.0/ < wxPython-src-2.9.4.1.patch

Configure and Build wxWidgets

cd ~/wxPython-src-2.9.4.0/bld
../configure --prefix=/usr/local

Build wxPython

sudo python build-wxpython.py --build_dir=../bld --wxpy_installdir=/usr --installdir=/usr

Set your PYTHONPATH variable to ~/wxPython-src-2.9.4.0/wxPython
Set your LD_LIBRARY_PATH to ~/wxPython-src-2.9.4.0/bld/lib

Note: This setup has been tested to work on Fedora 17.

In which (I hope) I found the right Google Reader replacement

Aside from Google Search and Gmail, Google Reader is the only other Google product that I use regularly. I check Google Calendar from time to time, I have lots of documents in Google Drive and some photos in Picasa Web, but I don’t use them as much as I use Google Reader. I check Google Reader when I’m on my way to and from the office, or whenever I’m alone and on the go. I use Google Reader during my idle moments when I’m at home. This morning, I was shocked to read from my Google Reader Android app that Google is Powering Down Google Reader. How ironic was that?

I use Google Reader to keep up with my 145 subscriptions, which includes personal blogs, web comics, programming, finance, gaming, sports, and start-ups. Since May 31, 2007 I have read a total of 127,223 items. And that’s not even a lot considering I know someone who has read more than 300,000+ items starting 2010.

Perhaps, my sentiments regarding this issue can be best summarized in this video:

so wouldn’t discuss more about that. Instead, here’s a brief summary of how I immediately looked for a Google Reader replacement after reading the sad news.

There are a couple of things I need from an RSS Reader that Google Reader has and it will be difficult to transition to something that offers half the features. So I’ve setup a list of required features I need for the replacement:

  • Should be accessible via the web (Duh!)
  • Should have a dedicated Android app. One of the reasons why I acquired a Galaxy Nexus last year was so I can read my Google Reader items while on the go
  • Should allow seemless exporting of Google Reader subscriptions, including archived posts, Starred items and Folders
  • Should allow signing-in using Google accounts
  • Should allow social sharing

Optional features:

  • Web UX/UI similar to Google Reader
  • Shotcut keys similar to Google Reader
  • Android app UI similar to Google Reader Android app

Based on the suggestions from Quora, I will be looking at NewsBlurThe Old Reader, Rolio, Netvibes, Feedly, SwarmIQ, Good Noows, and Skim.Me.

Newsblur

Has an option to “Import from Google Reader”. But as of this writing, it’s taking Newsblur years to import my Google Reader contents. I’m not even sure if it already encountered and error but still shows the bouncing loading gif. Perhaps because all other migrants are doing the same. It goes to show that the site isn’t ready to accommodate lots of users.

The Old Reader

Has an option to log in using a Google Account. But when I clicked the Import link, it gave me this message:

Hey! Because of the huge load we started seeing from lots of concurrent feed import operations, we had to limit the number of imports active at any given time. It looks like right now there are no available slots left, so you might want to visit this page some time later. Meanwhile, feel free to subscribe to feeds manually.
Please accept our apologies for this inconvenience.

Rolio

It required me to provide a username and password. End of story.

Netvibes

Requires users to pay $499/month just to enable tagging and searching. Err…

SwarmIQ

Skipped this when I noticed that the one who posted this on Quora was part of the SwarmIQ team. I’d rather spend my time evaluating something others have actually tried and didn’t self-promote.

Good Noows

It allowed me to sign-in using my Google Account, but I was turned off by the magazine-style layout and didn’t immediately present a way for me to import my Google Reader stuff.

Skim.Me

The site still requires an invitation and requests to manage my YouTube account, contacts, calendars, and perform those operations when I’m not using the application. Totally unnecessary.

The Winner: Feedly

It doesn’t have the exact UI of Google Reader, but the layout is pretty much the same. The UX is almost identical. Some of the shortcut keys even work (at least those that I’ve tried). Their Android app also looks usable. Currently, the data they show is still coming from Google Reader, but the good news is that they have a plan to seamlessly transition to their own back end. Since there’s really no other decent alternative, I’m giving Feedly a go.

P.S. I’m still hoping Google with take their announcement back and realize the huge mistake they’re going to make by shutting down Google Reader.

Note: This post will be updated in case I find a better Google Reader alternative.