Drupal 7

FCB New York

Senior Operations Engineer
Center for Tobacco Products www.therealcost.gov - under FDA / HHS

FDA (Center for Tobacco Products) – Senior Operations Engineer

Time Inc

Onsite Team Lead
Mindtree / Reveille

Backend Drupal Developer and team lead for Junior- to Mid-level developers. Scrum Master responsible for leading an Agile dev team and related work – creating tickets, grooming, estimating, code reviews, etc. Wrote php code using Drupal and related module APIs to accomplish business goals and reproduce existing functionality. Followed detailed business rules for building and maintaining Drupal sites at local, dev, qa, and production levels. Tools used: Drupal 7, CSS, git / git.com, MySQL, VMWare, bash, Jenkins, Jira, Confluence.

Attach an existing file to a node programmatically

 * Code that will enable attachment of a pre-existing file on the filesystem
 * to a node that requires it. 
function attach_file(&$node, $file_location, $lang = 'en') {
  global $doc_base_path;

  $file_location = str_replace('\\','/', $file_location);

  $actual_file = $doc_base_path . "/" . stripslashes($file_location);
  if (!file_exists($actual_file)) {
    print "**** FILE NOT FOUND ****\n";
    print $actual_file;
    print "^^^^ FILE NOT FOUND ^^^^\n";
  } else {

    print "File GOOD\n";
    print "Filesize: " . filesize($actual_file);

Import and Translate Drupal 7 Taxonomy Terms

But you'll never get those pesky entity titles !!

It'll take a bit of doing. And it took me sooo long to work out. Several modules will get you close... but not complete. Infact, I gotta revisit this post because I think it even depends on some detail in the order in which you do things. Perhaps tomorrow.

Here's the awesome Drupal module combination that I end up using:

Attach an Existing File to a Node... Programmatically

and the need to consider languages / translations.

Hi!! I'm excited 'cause I just spent another hour figuring out something that wasn't exactly rocket science... but a fairly obscure solution for my "special case".

United Nations

Lead Developer and Architect
Trigyn, Inc

Offer direction on how to accomplish various tasks in the leanest manner possible sometimes requiring new architecture. Troubleshoot, document, and fix failed Drupal migrations. Provide solutions for migrating to Drupal the many hundreds of sites built on other platforms. Script the migration process as much as possible to automate content migration. Write custom modules to accomplish many detailed requests for Drupal site behavior. Built Permissions and Roles based module to regulate who edits translated content which also created new roles and permissions as new languages are added.

JPMorgan Chase

Customer Experience Engineering; Developer

Built a Sales and Marketing tool on the Drupal 7 platform intended for online and offline use after conversion with Phone Gap and MoSync for various tablets and iPads. Custom module development leveraging various theme, Form, Views, and permission hooks and api functions. Coupling them with JavaScript libraries and some light image processing now enables sales teams to draw once, then project 'hot areas' onto resized images.

American Media, Inc

Software Developer

Handled perpetual feature requests and bug fixes on various high-trafficked AMI web properties using the Drupal 6 an Drupal 7 platforms. Required to update and fix software initially built by third party contractors often revisiting best practices both for PHP and Drupal. Built initial stages of Muscle & Fitness redesigned website on Drupal 7 requiring some responsive design techniques and incorporating Javascript/JQuery controls. Used Agile practices in planning, building, and repairing all properties.

killed my menu with hook_menu_alter

Then I couldn't access any admin pages. Meaning of course that I could not then clear my caches... INCLUDING the menu cache to restore it.

Truncating the database cache tables also did nothing to help.

Hindsight tells me I could have investigating rebuilding the registry... maybe.

What fixed it was simply running /update.php

Of course, it helps if you're logged in already as user 1 /admin. I couldn't even log out actually, because that access goes through the menu module as well.

Mess up your modules, Mess up your registry...

and mess up your Drupal site "permanently". Not Really.

I screwed up my Drupal project one day by copying my modules directory and forgetting to move it out of it's parent directory. Details are unimportant.

The point is, I cleared my cache and did a few other things and Drupal started looking for modules in a location that was unavailable. Needless to say (I hope needless anyway), the system and registry tables were out of sync with some of the modules.
Fixing (or so I thought) the registry table manually was unsuccessful.


Subscribe to RSS - Drupal 7