Problem/Motivation
Enabling a single media type seems to work well and allows creating media in a group via /group/1/media/create
Enabling multiple types of media on a group type causes errors, starting with this:
ArgumentCountError: Too few arguments to function Drupal\groupmedia\Controller\GroupMediaController::addPageBundles(), 2 passed in /app/web/modules/contrib/groupmedia/src/Controller/GroupMediaController.php on line 44 and exactly 3 expected in Drupal\groupmedia\Controller\GroupMediaController->addPageBundles() (line 72 of modules/contrib/groupmedia/src/Controller/GroupMediaController.php).
Steps to reproduce
- Install Group 3.0.0-beta4, Group Media 4.0.0-alpha-1, Drupal 9.4.8
- Create a group type
- Enable multiple content plugins, for example: Group media (Image) and Group media (Document)
- Create a group
- Go to /group/1/media/create
- See the above error.
Issue fork groupmedia-3325129
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
finn lewisThis line: https://git.drupalcode.org/project/groupmedia/-/blob/4.0.x/src/Controlle... does need another argument for addPageBundles, see https://git.drupalcode.org/project/groupmedia/-/blob/4.0.x/src/Controlle...
Adding that then gives:
TypeError: Illegal offset type in isset or empty in Drupal\groupmedia\Controller\GroupMediaController->addPage() (line 45 of modules/contrib/groupmedia/src/Controller/GroupMediaController.php).Editing those lines to get the actual bundle name
Then gives the following error:
Drupal\Component\Plugin\Exception\PluginNotFoundException: Plugin ID 'microsite-group_media-document' was not found. in Drupal\Core\Plugin\DefaultLazyPluginCollection->initializePlugin() (line 79 of core/lib/Drupal/Core/Plugin/DefaultLazyPluginCollection.php).Comment #4
finn lewisHi @LOBsTerr
I've created a merge request that fixes the issue for me.
Could you take a look and see if I've done it right?
Many thanks,
Finn
Comment #5
lobsterr commentedComment #7
lobsterr commentedThanks for your contribution
Comment #8
finn lewisThanks LOBsTerr! You're so on it! If we could get another tagged release.... that would be awesome!
Comment #10
finn lewisOMG - you're just too quick... thanks dude!
Comment #11
lobsterr commentedHeh, you are welcome
Comment #12
lobsterr commentedI just realized it was a wrong approach. I will introduce a new changes soon
Comment #14
lobsterr commentedComment #15
lobsterr commentedI have removed controller completely, because we don't need it anymore. We will use group default functionality.