O'Reilly logo

Programming Drupal 7 Entities by Sammy Spets

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Converting the recipe content type to use fields

Our conversion of the recipe module to use fully-fledged entities can continue now, and we will convert all of the database fields in the recipe table to entity fields. Converting the structure is only a part of the task. There are many code changes necessary to ensure that all supporting code correctly manipulates the new structure. The steps we will take to upgrade the module code are as follows:

  1. Create the fields using the UI.
  2. Export them to code inside a feature.
  3. Put the exported declarations into recipe module and convert field name prefixes to recipe_.
  4. Tweak the recipe module code so that the old fields don't clobber the new ones in the field admin UI, and add link, number, text, and token modules ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required