Skip to main content

Documentation added for supported hooks and APIs in Retrofit for Drupal

Published on

Retrofit for Drupal now has documentation to explain what Drupal 7 hooks and APIs are supported. Retrofit for Drupal provides backward compatibility layers to run legacy Drupal 7 code in your sites using Drupal 10 and beyond. The problem, however, is anyone evaluating Retrofit for Drupal has had to take time to give it a test run and "see what happens." The documentation explains the various backward compatibility layers.

Documentation is critical for open source projects. Especially for a project that doesn't add functionality but ensures functionality for existing code continues to work. I hit some decision paralysis on how to set up documentation. The point of Retrofit for Drupal is to avoid having to configure our change code. However, the common question was, "But what hooks does it support?" Now, there is documentation within the repository to document the following:

Unfortunately, this doesn't cover the fact certain functions are supported, such as all database functions or variable_get and variable_set. I'll be adding more information shortly.

It isn't a perfect solution. I need to solicit feedback on checking "Is this hook supported?" I assume it would involve some search feature, like Drupal's API reference. The problem is that I don't want to build API documentation about Retrofit for Drupal and its internals. One idea I had was a mapping file somewhere that would allow mapping a component of Drupal 7 (functions, hooks, concepts) to its backward compatibility layer components in Drupal 7. Maybe there could be a way to use phpDocumentor or ApiGen and PHP attributes to solve this problem.