Install error - Documentation needs updating

Created on 26 October 2023, about 1 year ago
Updated 24 January 2024, 11 months ago

I get this error when installing by drush:

drush en mongodb_watchdog
PHP Fatal error: Declaration of Drupal\mongodb_watchdog\EventTemplateConverter::convert(Drupal\mongodb_watchdog\mixed $value, $definition, $name, array $defaults): ?Drupal\mongodb_watchdog\EventTemplate must be compatible with Drupal\Core\ParamConverter\ParamConverterInterface::convert($value, $definition, $name, array $defaults) in /var/www/clients/client1/web21/web/web/modules/contrib/mongodb/modules/mongodb_watchdog/src/EventTemplateConverter.php on line 56
[warning] Drush command terminated abnormally.

I've copied the settings from the example into settings.php, enabling mongodb_storage with drush worked.

๐Ÿ’ฌ Support request
Status

Fixed

Version

2.1

Component

Watchdog (logger)

Created by

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

Comments & Activities

  • Issue created by @webberly
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia Shreya_98

    Shreya_th โ†’ made their first commit to this issueโ€™s fork.

  • Assigned to Shreya_98
  • @shreya_th opened merge request.
  • Issue was unassigned.
  • Status changed to Needs review about 1 year ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia Shreya_98

    Hi @webberly,
    I have fixed this issue and also created MR for this issue. Kindly review the changes.

  • Status changed to Postponed: needs info about 1 year ago
  • ๐Ÿ‡ซ๐Ÿ‡ทFrance fgm Paris, France

    This MR does not appear to be related to the document at all, does it ?

  • Thank you Shreya_th that worked, Fgm, Im using php7.4 and the latest dev version of mongodv and drupal 9.5.7.
    Is there any examples of how i can use mongodb to store taxonomy terms or commerce entities?
    Thank you.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia Shreya_98

    @webberly ,
    We can use MongoDB to create collections for each entity type. Here's an example for storing product data:

    {
    "_id": 1,
    "name": "Product Name",
    "description": "Product description",
    "price": 29.99,
    "category": "Electronics",
    "tags": ["electronics", "gadgets", "tech"],
    "stock_quantity": 100
    }

  • Thank you Shreya_th,
    I can see the id needs to have an underscore preceding in the object, but how do I get to that stage?
    If i want to store commerce_Product or variation types or attributes in mongodb, how do i change the existing storage? in hook_entity_type_alter and ->setstorageclass(), Do i write a whole new class or use a mongodb class?

  • ๐Ÿ‡ซ๐Ÿ‡ทFrance fgm Paris, France

    Thanks for the details:

    • Installation should not have been possible with PHP 7.4 as the module no longer supports it: the composer file requires PHP >= 8.0. How did you install the module ? Composer should have blocked the install because of that requirement.
    • With Drupal 9 EOL being in just 4 days now, the ongoing requirements for 8.x-2.x will be Drupal 10 and PHP 8.2. While technically allowed with 8.x-2.1, Drupal 9 is no longer supported
    • Versions in the 8.x-2.x do not allow storing entity/field data in MongoDB: they only offer a logger, keyvalue, and queue services.
    • To store everything else in MongoDB, you need either the ttps://gitlab.com/daffie/mongodb867 repo or the complete https://gitlab.com/daffie/drumongous distribution. You can ask about those in the #mongodb slack channel, but keep in mind these are experimental, as explained by their author @daffie in his talks at DrupalDevDays Vienna and DrupalCon Lille

    In summary:

    • If you want to store entity/field data in MongoDB you will need the experimental versions, not 8.x-2.x
    • If you want the stable supported version
      • you will not be able to store entity/field data in MongoDB, only logs, KV and queue
      • you will have to use PHP 8.2 and Drupal 10.x
  • Status changed to Fixed 12 months ago
  • ๐Ÿ‡ซ๐Ÿ‡ทFrance fgm Paris, France

    That was actually a support issue.

    No answer from OP and other user in over two months. Assuming fixed by last answer.

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

Production build 0.71.5 2024