Loading src/Plugin/EntityBrowser/Widget/PexelsWidget.php +6 −1 Original line number Diff line number Diff line Loading @@ -410,10 +410,15 @@ class PexelsWidget extends WidgetBase { $results = $this->pexelsClient ->setApiKey($this->configuration['api_key']) ->search($input['keyword'], $this->defaultPerPage, $page, $input['orientation'] ?: '', $input['color'] ?: ''); if (!isset($results['contents'])) { throw new \Exception('Result contents were empty.'); } $search_results = $results['contents']; } catch (\Exception $e) { $this->messenger()->addError('There was an error while fetching the results. Please contact the system administrator.'); $this->messenger()->addError($this->t('There was an error while fetching the results. Please contact the system administrator.')); $this->loggerFactory->get('media_pexels')->error($e->getMessage()); return $form; } Loading Loading
src/Plugin/EntityBrowser/Widget/PexelsWidget.php +6 −1 Original line number Diff line number Diff line Loading @@ -410,10 +410,15 @@ class PexelsWidget extends WidgetBase { $results = $this->pexelsClient ->setApiKey($this->configuration['api_key']) ->search($input['keyword'], $this->defaultPerPage, $page, $input['orientation'] ?: '', $input['color'] ?: ''); if (!isset($results['contents'])) { throw new \Exception('Result contents were empty.'); } $search_results = $results['contents']; } catch (\Exception $e) { $this->messenger()->addError('There was an error while fetching the results. Please contact the system administrator.'); $this->messenger()->addError($this->t('There was an error while fetching the results. Please contact the system administrator.')); $this->loggerFactory->get('media_pexels')->error($e->getMessage()); return $form; } Loading