Composer.json does not declare dependency on commerce* modules

Created on 21 December 2022, almost 2 years ago
Updated 19 January 2024, 10 months ago

Problem/Motivation

The composer.json of this module does not declare any dependencies, but it uses classes from commerce modules (commerce_cart, commerce_price, commerce_order, etc). Those classes will not be available if the module is installed without the commerce modules on the system. This can cause runtime errors in certain situations.

Steps to reproduce

1. Install this module
2. Install webprofiler module
3. try to navigate the site (will cause error because web profiler attempts to initialise all services it finds, and e.g. the priceresolver service throws errors).

Proposed resolution

As a first step declare the necessary dependencies in the composer.json.

A more future proof option might be to split the code that handles the commerce integration into a separate module. Not everybody uses the Commerce integration, so would be unnecessary to install those dependencies just to get the module to not throw errors.

Will make a patch for the first option.

🐛 Bug report
Status

Postponed: needs info

Version

1.2

Component

Code

Created by

🇫🇮Finland jwwj

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • Status changed to Postponed: needs info 11 months ago
  • 🇮🇹Italy afagioli Rome

    First step is part of forthcoming release

    The a more future proof option would require a few more better defined use cases of BEE without commerce integration.

    Thanks so far.

  • 🇫🇮Finland jwwj

    Here is one use case: In our project the customer has rooms that they allow their members to book, and we have implemented this feature using bee. There is no need for any payment to use these rooms, so there is no need for a commerce integration. Thus, in this case having a dependency on modules from the Drupal Commerce ecosystem is unnecessary and would just add unnecessary complexity to the maintenance of the site and potentials for bugs / security vulnerabilities to creep in.

    Basically, any use case where there is a need to book something, but NOT a need to ask for payment would be a use case for NOT having an integration to the Drupal Commerce ecosystem. Another such example could be lending of equipment within a company or a neighbourhood (sharing economy).

  • 🇮🇹Italy afagioli Rome

    what exposed at #4 makes sense to me

    sidenote:
    * BEE relies on BAT
    * BAT [bat_options] relies on commerce

Production build 0.71.5 2024