Problem/Motivation

We noticed those notices in our logs. After a while, we could not reproduce that again. Maybe the sevice endpoint was unavailable?

Steps to reproduce

Use the Pexels EB widget to search.

Proposed resolution

Add some isset checks for those responses for now.

Remaining tasks

User interface changes

API changes

Data model changes

Comments

Primsi created an issue. See original summary.

primsi’s picture

Status: Active » Needs review
StatusFileSize
new1.48 KB
primsi’s picture

StatusFileSize
new1.59 KB

Adding an error if quota data is unavailable.

primsi’s picture

StatusFileSize
new1.32 KB

Assuming that's not just the quota data that is missing. Also fixing wrong parameter setting.

berdir’s picture

+++ b/src/Plugin/EntityBrowser/Widget/PexelsWidget.php
@@ -410,11 +410,17 @@ class PexelsWidget extends WidgetBase {
+
+        if (!isset($results['contents'])) {
+          throw new \Exception('Result contents were empty.');
+        }

this should be a translatable string as it's non technical and can happen with regular usage as well. to avoid passing a translatable string in the exception we could maybe check when we display the results if the result list is empty? not sure.

primsi’s picture

StatusFileSize
new1.45 KB

Thanks for the review. We do display a message if results are empty (see the catch part). But that message was not translatable. Fixing that.

  • Primsi committed e4ee841 on 1.x
    Issue #3303102 by Primsi: Undefined array key "X-Ratelimit-Limit"  error
    
primsi’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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