From f130d7f1025fa4e204320b146ef8b33ac873998a Mon Sep 17 00:00:00 2001 From: Paul Byrne Date: Mon, 18 Apr 2016 12:32:40 +0100 Subject: [PATCH] Improve exception message for missing selector The original message was unclear/incorrect, stating the selector value must begin with 'edit-', whereas I have found the selector needs to include the hash symbol. --- src/Drupal/ContentTypeRegistry/Widgets/MediaBrowserWidget.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Drupal/ContentTypeRegistry/Widgets/MediaBrowserWidget.php b/src/Drupal/ContentTypeRegistry/Widgets/MediaBrowserWidget.php index 6e3e723..1cfffc7 100644 --- a/src/Drupal/ContentTypeRegistry/Widgets/MediaBrowserWidget.php +++ b/src/Drupal/ContentTypeRegistry/Widgets/MediaBrowserWidget.php @@ -45,7 +45,7 @@ public function fill($I, $value) if (!preg_match('/^#edit\-([\w\-]+)\-upload$/', $selector, $matches)) { throw new \InvalidArgumentException( - "Must specify the input field, beginning with edit- and ending in -upload" + "Must specify the input field, beginning with '#edit-' and ending in '-upload'." ); }