Updated all the contrib modules to their latest versions.
[yaffs-website] / web / modules / contrib / entity_browser / src / Entity / EntityBrowser.php
index 53bc9f2aff5efde138786b9da1dea79898b4fe80..be75e6c2da3f82c7a023fe2be14aba99c0c46ac0 100644 (file)
@@ -303,6 +303,14 @@ class EntityBrowser extends ConfigEntityBase implements EntityBrowserInterface,
    */
   public function getFirstWidget() {
     $instance_ids = $this->getWidgets()->getInstanceIds();
+    $instance_ids = array_filter($instance_ids, function ($id) {
+      return $this->getWidget($id)->access()->isAllowed();
+    });
+
+    if (empty($instance_ids)) {
+      return NULL;
+    }
+
     return reset($instance_ids);
   }