Problem/Motivation

I recently updated the drupal core to version 10.0.0 for my project and started to face issue:
Error: Class "pimax\FbBotApp" not found in Drupal\dbb\Controller\NodeRedirectController->sendButtons() (line 288 of /app/web/modules/contrib/dbb/src/Controller/NodeRedirectController.php).
I am testing the facebook chatbot API on platform.sh.
pimax library were installed with composer require alefinvest/fb-messanger-php
So as solution i moved code from pimax package into my module namespace so the functionality works.
But this solution as far as i understand is not correct in relations with ownership of code in pimax package.

Proposed resolution

Improve autoloading of external packages.

Steps to reproduce

1. Setup fresh drupal core installation from Deploy Drupal 9 on Platform.sh
2. composer require drupal/dbb:1.0.6
3. Extend root composer with the following code:

"repositories": [
    {
      "type": "composer",
      "url": "https://packages.drupal.org/8"
    },
    {
      "type": "package",
      "package": {
          "name": "alefinvest/fb-messenger-php",
          "version": "1.1",
          "type":"drupal-library",
          "source": {
              "url": "https://github.com/alefinvest/fb-messenger-php.git",
              "type": "git",
              "reference": "master"
          }
      }
    }
  ]

4. composer require alefinvest/fb-messenger-php
5. Create facebook application Choose one for messenger (Business type)
6. Setup drupal Standart profile in drupal 9.5
7. Enable the module Drupal Bot Builder (dbb)
8. Create new content of type chatbot_webhook.
9. Connect the FB app webhook to the newly created content chatbot_webhook with URL to your node/1
10. Connect the FB app to some of the FB page you own.
11 Make sure that messages are delivered via FB API to drupal webhook.
12. Update drupal core to 10.0.0
13. Make sure that class pimax/FbBotApp could not be found.

Comments

alex.mazaltov created an issue. See original summary.

alex.mazaltov’s picture

Issue summary: View changes
cilefen’s picture

Priority: Critical » Normal

Support requests cannot be critical or major priority.

cilefen’s picture

I want to help however I do not clearly understand this support request. The bot builder module does not have a composer.json file and so does not depend on alefinvest/fb-messenger-php.

alex.mazaltov’s picture

Thank you for your willing to support. Yes the module do not containe composer.json file it is because cureently the external package was included in latest module version. You need to extend root composer wit code to fetch external package from github alefinvest/fb-messenger-php. Let me know if i can help you to deep into. I am very excited that you proposed you support. May be we can coordinate our contribution with online meeting.

cilefen’s picture

You may get better support in the #support channel of Slack because there would be a lot of questions. To begin, you forked a library but did not publish it on https://packagist.org, which would be the usual way to make the library available to Composer.

alex.mazaltov’s picture

Status: Active » Fixed

The issue was fixed in the module Drupal/dbb branch 1.1.x
I will create a new release 1.1 from 1.1.x-dev branch

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.