1

Reading the Drupal Changes records I found that drupal_get_message() and drupal_set_message() replaced by Messenger service so lets suppose that I have a module that use the drupal_get_message() function and I want to replace it with the new Messenger service. If I do it my module only will works starting from Drupal Core >= 8.5.

So, in this point what is the correct way to produce the next module release?

Should I restrict the next release to a specific Core version adding a comment in the release notes or should I create a new branch (lets says 8.x-2.x) to implement this changes and have two module versions like 8.x-1.x (working for Core < 8.5) and 8.x-2.x (working for Core >= 8.5)?

4

( Originally wrote this as an answer directly in slack)

There is no need for a new branch in your module as long as your own API doesn't change IMHO. The version definition will prevent that users update too early.

There is also no need to continue providing versions compatible with old core versions, they are no longer supported.

If it's just about deprecated usages, there's no reason to hurry, you can easily wait a few month/next core minor before starting to use it to give your users time to update. All those deprecated functions will only be removed in the 9.x branch, so you have plenty of time to update. It's different if core broke something in your module and you're forced to update asap or if there is a completely new API that you'd want to use.

Somewhat related: http://www.doctrine-project.org/2017/07/25/php-7.1-requirement-and-composer.html (last paragraph there). Their PHP version dependency is similar to your Drupal core dependency.

  • As additional info @bojanz says: each time a new core major drops, I update the codebase and raise the minimum core requirement in info.yml and composer.json (in Commerce and other modules) – Adrian Cid Almaguer Apr 4 '18 at 17:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.