Problem/Motivation

If you have not entered the in unsplash credentials in intermediate field settings and you start adding media items then you will get this error:

The website encountered an unexpected error. Try again later.

Unsplash\Exception: ["OAuth error: The access token is invalid"] in Unsplash\Endpoint::__callStatic() (line 98 of /var/www/html/vendor/unsplash/unsplash/src/Endpoint.php).
Unsplash\Photo::find('9SL_aTkpWaI') (Line: 61)
Drupal\media_entity_unsplash\UnsplashFetcher->fetchImage('9SL_aTkpWaI') (Line: 179)
Drupal\media_entity_unsplash\Plugin\media\Source\Unsplash->fetchImageT('9SL_aTkpWaI') (Line: 194)
Drupal\media_entity_unsplash\Plugin\media\Source\Unsplash->getMetadata(Object, 'thumbnail_uri') (Line: 266)
Drupal\media\Entity\Media->getThumbnailUri() (Line: 162)
Drupal\media\Entity\Media->updateThumbnail() (Line: 449)
Drupal\media\Entity\Media->prepareSave() (Line: 27)
Drupal\media\MediaStorage->save(Object) (Line: 354)
Drupal\Core\Entity\EntityBase->save() (Line: 293)
Drupal\Core\Entity\EntityForm->save(Array, Object) (Line: 61)
Drupal\media\MediaForm->save(Array, Object)

Documentation is not clear enough about selling credentials before doing anything.

Steps to reproduce

Enable to module. Add a media item.

Proposed resolution

Make some documentation changes suits more explicit did you need to enter the credentials? Also explain where to find the credentials.

Improve the error message.

Remaining tasks

Everything

User interface changes

Improved error message

API changes

Data model changes

Command icon 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

batigolix created an issue. See original summary.

batigolix’s picture

Version: 2.0.x-dev » 1.0.x-dev

batigolix changed the visibility of the branch 3532906-better-documentation- to hidden.

batigolix’s picture

Status: Active » Needs review

fabianderijk made their first commit to this issue’s fork.

fabianderijk’s picture

Status: Needs review » Fixed

Thanks! I've merged the merge request

Status: Fixed » Closed (fixed)

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