When using the Spotlight widget, there is only an option to upload new photos each time. It would be great if you could choose an existing photo from the media library instead.
This will prevent users from having to upload the same photo multiple times. We also supply our customers with a library of approved stock images, and this improvement would allow them to select these images when utilizing the Spotlight widget.
This improvement would allow for a consistent interface for adding media. When adding media via the WYSIWYG, users can select photos from the library as well as upload new ones.
Would it be possible to allow the Add Spotlight widget to use the Media Browser? See https://www.drupal.org/node/2340811 for a similar issue for the Add Image widget.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | panopoly_test-spotlight-media-2774911-3.patch | 1.29 KB | dsnopek |
| #2 | panopoly_widgets-spotlight-media-2774911-2.patch | 1.86 KB | dsnopek |
Comments
Comment #2
dsnopekHere's a patch that implements this! After much trial and error, it actually appears to be way easier to do than I was fearing so that's nice. :-)
However, since this is using something internal-ish to the Media module and that module is known for drastic breaking changes, we should definitely have some Behat tests for this functionality before committing.
Comment #3
dsnopekI'm having lots of trouble getting the existing spotlight tests to run locally, I think because of changes in recent versions of Firefox. :-(
Anyway, here's an untested patch that should be enough to get the existing tests working. Putting it here so I can try it on Travis!
Comment #4
dsnopekI finally got these tests running locally (by downgrading to Firefox 46 and Selenium 2.53, just like on Travis). However, I couldn't come up with a good way of adding more complete test coverage without also solving some other problems, namely:
https://www.drupal.org/node/2428097
Also, my local development environment is also afflicted by https://github.com/minkphp/MinkSelenium2Driver/issues/187 which was already fixed upstream, but pulling the dev version from GitHub breaks everything :-(
So... I think the super simple test coverage that we already had is probably all we're gonna get without fixing mink and drush and those are both big endeavour
All that said, the tests are passing on Travis! And my local testing was pretty complete and all looked good. This could use some independent testing by someone other than me, but otherwise, it's probably all good (until we update Media again at least)
Comment #5
cboyden commentedTested this on a child distribution and it's working with the new version of Media, including choosing an image from the library as well as uploading a new one.
Comment #7
dsnopekCommitted! Thanks!
Comment #8
dsnopek