How to access object attributes based on a variable in Typescript

Typescript is obscurely particular with accessing attribute keys on objects that lack a generic signature. Adding generic signatures reduces type-safety though.

Here’s a Typescript-friendly way to verify an attribute exists in an object, and then access that attribute.

This post originally posted at https://blog.smartlogic.io/accessing-object-attributes-based-on-a-variable-in-typescript/

Drupal 7: Converting a text field to a long text (aka textarea) field

Realize later on that text field you created needs to actually be a long text field?  You’re not alone.

After doing some research, I found zero complete solutions.  The ones I found leave problemattic remnants in the database, which can cause hard to diagnose issues such as restricted field length.  See references.

Luckily for you, the drush script below will do a more complete conversion.

Thanks go out to the references though, for getting me started.

 

References:

  1. http://www.pixelite.co.nz/article/convert-existing-textfield-textarea-drupal-7/
  2. http://www.up2technology.com/blog/converting-drupal-fields/