The "nextcloud_media" plugin does not exist.

Created on 21 December 2024, 5 days ago

Problem/Motivation

Hello,

I installed this module and tried to create a new Nextcloud image media with the "Nextcloud URL" field set url of the image asset shared on the source Nextcloud site, then got the message.

If you have any idea about the cause, could you show me, please?

Thank you.

💬 Support request
Status

Active

Version

1.0

Component

Miscellaneous

Created by

🇯🇵Japan bkenro

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

Comments & Activities

  • Issue created by @bkenro
  • 🇪🇸Spain aleix

    Hi @bkenro . Let's see if you did the required setup. Did you picked the remote share with the filepicker in widget field? Or just filled the field url with the remote url? If thats the case i am sorry but just using the url without using the picker will not populate the metadata, (but it may be implemented at some point)

    To confirm and be more specific, i need more information to reproduce. Could you send the configuration of the next cloud media image? the ymls of the media, the yml of the view modes and form modes, the yml of the field storage and formatter... If not a screen capture video may help.

  • 🇯🇵Japan bkenro

    @aleix, thank you so much for your help. My procedure was as follows.

    First I cloned the Drupal 10.4.0 project locally:
    https://www.drupal.org/project/drupal/releases/10.4.0

    After adding drush, I setup a new site with the standard profile:
    drush site:install standard -y

    then add the latest alpha Nextcloud DAM module:
    composer require 'drupal/nextcloud_dam:^1.0@alpha'

    and enabled it with its required modules as well:

    According to the project's "Post-Installation" guidance , I added the new Media field "field_nc" to the "article" content type. This field references the "Nextcloud image" Media type that was automatially created during module installation:

    Next I moved to the "Manage form display" tab, and change the widget of the field_nc field to "Entity browser":

    then click the gear icon and adjust the settings of the form field configs as described on the project page:

    After that, the "Edit Widgets" under "Entity Browsers" config page looks as follows:

    Next I tried to create new "article" node then I got the error:

    The website encountered an unexpected error. Try again later.

    I checked the watchdog and found the message entry:

    TypeError: key(): Argument #1 ($array) must be of type array, null given in key() (line 424 of /var/www/demo/web/modules/contrib/entity_browser/src/Plugin/Field/FieldWidget/EntityReferenceBrowserWidget.php).

    Here stucked... so I tried to create a new Media content from the path /media/add/nextcloud_image:

    then I got the message again:

    The website encountered an unexpected error. Try again later.

    and found the message in the anotehr watchdog entry:

    Drupal\Component\Plugin\Exception\PluginNotFoundException: The "nextcloud_media" plugin does not exist. Valid plugin IDs for Drupal\Core\Validation\ConstraintManager are: Callback, Blank, NotBlank, Email, Choice, Image, BlockContentEntityChanged, UniqueLabelInList, CKEditor5Element, CKEditor5ToolbarItemConditionsMet, CKEditor5FundamentalCompatibility, CKEditor5EnabledConfigurablePlugins, CKEditor5MediaAndFilterSettingsInSync, StyleSensibleElement, CKEditor5ToolbarItem, CKEditor5ToolbarItemDependencyConstraint, SourceEditingPreventSelfXssConstraint, SourceEditingRedundantTags, CommentName, DateTimeFormat, EntityBrowserImageDimensions, FileSizeLimit, FileExtensionSecure, FileImageDimensions, FileValidation, FileExtension, FileIsImage, FileUriUnique, FileNameLength, LinkType, LinkNotExistingInternal, LinkAccess, LinkExternalProtocols, MediaMappingsConstraint, oembed_resource, MenuTreeHierarchy, MenuSettings, PathAlias, TaxonomyHierarchy, ProtectedUserField, UserMailRequired, UserName, UserMailUnique, UserNameUnique, PluginExists, ExtensionExists, ExtensionName, ValidPath, UniquePathAlias, ImmutableProperties, EntityType, EntityChanged, ValidReference, ReferenceAccess, Bundle, EntityUntranslatableFields, EntityHasField, Uuid, ValidKeys, Count, AllowedValues, PrimitiveType, Length, FullyValidatable, ComplexData, UniqueField, Null, Range, CountryCode, NotNull, Regex, EntityBundleExists, LangcodeRequiredIfTranslatableValues, ConfigExists, RequiredConfigDependencies in Drupal\Core\Plugin\DefaultPluginManager->doGetDefinition() (line 53 of /var/www/dsrv/web/core/lib/Drupal/Component/Plugin/Discovery/DiscoveryTrait.php).

    Could you point out any mistake or missing in my setup?

    Thank you.

  • 🇪🇸Spain aleix

    Great! let's see, It happens before loading the node form or after submitting the node form?
    As I said, filling the media via media form, without using entity browser is not implemented (it must be at some moment).

  • 🇪🇸Spain aleix

    I try to reproduce, but no way... The key error in:

    TypeError: key(): Argument #1 ($array) must be of type array, null given in key() (line 424 of /var/www/demo/web/modules/contrib/entity_browser/src/Plugin/Field/FieldWidget/EntityReferenceBrowserWidget.php).

    refers to entitybrowser, could you paste the entitybrowser config from single export in config > development and also the entity form view of the article content ?

    (also the answers to the questions in previous comment could help)

    ...

    Let's see if we can solve this.

  • 🇯🇵Japan bkenro

    The error occurred after loading the node form. But I failed to open the filepicker and it seems not to be able to connect to the asset source.

    The message says that it was blocked to connect.

    In order to share my setup with you, I created GitHub project:
    https://github.com/bkenro/nextcloud-dam-trial
    I exported my current config into config/sync folder, so I hope you can restore it. Any comment is appreciated!

    Thank you.

  • 🇪🇸Spain aleix

    I am sorry but I couldn't reproduce despite I installed everything from your repo from the scratch, I have set the php environment again with php8.3.
    What I see was that the load of the filepicker inside the modal was triggering:

    Allowed memory size of 134217728 bytes exhausted (tried to allocate 134217736 bytes) in drupal-project/vendor/mck89/peast/lib/Peast/Syntax/Utils.php on line 37

    And the filepicker was not appearing (I am using firefox, maybe in chromium i could see your modal error). The error was the same if setting the entity browser to be standalone form .

    I have not inspected too deeply but I suppose that it's because i was using js aggregation or the load of nc filepicker libraries together with xdebug , a low memory_limit and 30 seconds of execution limit for php.
    Anyway disabling xdebug make it work...

    Maybe you have xdebug enabled? or low php memory_limit ?

    I try to inspect a little more if this js load could be reduced, or try to load differently the vue filepicker (async???) to prevent this wait and allow the use of xdebug but by now disabling xdebug just to allow the load (after first load it may be enabled again) it's the way to make it work (if you face with the same xdebug issue) .

Production build 0.71.5 2024