Missing proxy class 'Drupal\book_tree_menu\ProxyClass\oscBookManager' for lazy service 'book.manager

Created on 7 January 2024, about 1 year ago
Updated 25 March 2024, 11 months ago

Problem/Motivation

After updating to D10.2 proxy class is needed from book module

Proposed resolution a proxy class is generated using this command
php core/scripts/generate-proxy-class.php 'Drupal\book_tree_menu\oscBookManager' "docroot/modules/contrib/book_tree_menu/src"

and then made changes to the generated class to take book manager instead of BookManagerInterface

πŸ› Bug report
Status

Needs review

Version

2.0

Component

Code

Created by

πŸ‡―πŸ‡΄Jordan suhaib_hija

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

Merge Requests

Comments & Activities

  • Issue created by @suhaib_hija
  • First commit to issue fork.
  • πŸ‡ΊπŸ‡ΈUnited States bkosborne New Jersey, USA

    Yes, this is needed, but in the patch provided you had the proxy class extend from BookManager, but I'm not sure why. I don't think you need to overwrite anything at all from what the script created. I created a Merge Request with the unaltered code of the created proxy class.

    Also bumping to major as this is needed for Drupal 10.2.x.

  • Status changed to Needs review 12 months ago
  • πŸ‡ΊπŸ‡ΈUnited States bkosborne New Jersey, USA
  • πŸ‡¨πŸ‡¦Canada al_trottier

    Creating a patch to add the file generated by the script.

  • πŸ‡¬πŸ‡§United Kingdom andy inman Gloucestershire, UK

    Patch #6 worked for me - the warning "Missing proxy class 'Drupal\book_tree_menu\ProxyClass\oscBookManager' for lazy service 'book.manager'" was previously appearing after every drush cr, it's gone after applying the patch.

  • πŸ‡³πŸ‡±Netherlands promes

    My Drupal version is 10.3.10 and book version 2.0.0-alpha5.
    After the initial install I got the error. I deinstalled the module. I patched the module with the patch of #6 and installed it again. Now I get this error:
    PHP Fatal error: Declaration of Drupal\\book_tree_menu\\ProxyClass\\oscBookManager::bookTreeAllData($bid, $link = null, $max_depth = null) must be compatible with Drupal\\book\\BookManagerInterface::bookTreeAllData(int $bid, ?array $link = null, ?int $max_depth = null, ?int $min_depth = null): array in /xxx/web/modules/contrib/book_tree_menu/src/ProxyClass/oscBookManager.php on line 72', referer: https://example.com/admin/modules

    And many more interface differences.

Production build 0.71.5 2024