Skip to content
Snippets Groups Projects
Unverified Commit f87d33ac authored by Lee Rowlands's avatar Lee Rowlands
Browse files

Issue #2966043 by phenaproxima, owenbush, a.dmitriiev, marcoscano, tapscolaM,...

Issue #2966043 by phenaproxima, owenbush, a.dmitriiev, marcoscano, tapscolaM, xtineroque, ramya.shankaralingam: Handle oEmbed resources without an explicit height
parent fd58fbe7
No related branches found
No related tags found
17 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!1896Issue #2940605: Can only intentionally re-render an entity with references 20 times,!1101Issue #2412669 by claudiu.cristea, Julfabre, sidharrell, catch, daffie,...,!1039Issue #2556069 by claudiu.cristea, bnjmnm, lauriii, pfrenssen, Tim Bozeman,...,!10223132456: Fix issue where views instances are emptied before an ajax request is complete,!1012Issue #3226887: Hreflang on non-canonical content pages,!872Draft: Issue #3221319: Race condition when creating menu links and editing content deletes menu links,!594Put each entity type table into a details element on admin/config/regional/content-language,!579Issue #2230909: Simple decimals fail to pass validation,!560Move callback classRemove outside of the loop,!555Issue #3202493,!512Issue #3207771: Menu UI node type form documentation points to non-existent function,!485Sets the autocomplete attribute for username/password input field on login form.,!449Issue #2784233: Allow multiple vocabularies in the taxonomy filter,!231Issue #2671162: summary text wysiwyg patch working fine on 9.2.0-dev,!43Resolve #3173180: Add UI for 'loading' html attribute to images,!30Issue #3182188: Updates composer usage to point at ./vendor/bin/composer
...@@ -236,7 +236,7 @@ public static function link($url = NULL, Provider $provider = NULL, $title = NUL ...@@ -236,7 +236,7 @@ public static function link($url = NULL, Provider $provider = NULL, $title = NUL
* @param int $width * @param int $width
* The width of the photo, in pixels. * The width of the photo, in pixels.
* @param int $height * @param int $height
* The height of the photo, in pixels. * (optional) The height of the photo, in pixels.
* @param \Drupal\media\OEmbed\Provider $provider * @param \Drupal\media\OEmbed\Provider $provider
* (optional) The resource provider. * (optional) The resource provider.
* @param string $title * @param string $title
...@@ -260,7 +260,7 @@ public static function link($url = NULL, Provider $provider = NULL, $title = NUL ...@@ -260,7 +260,7 @@ public static function link($url = NULL, Provider $provider = NULL, $title = NUL
* *
* @return static * @return static
*/ */
public static function photo($url, $width, $height, Provider $provider = NULL, $title = NULL, $author_name = NULL, $author_url = NULL, $cache_age = NULL, $thumbnail_url = NULL, $thumbnail_width = NULL, $thumbnail_height = NULL) { public static function photo($url, $width, $height = NULL, Provider $provider = NULL, $title = NULL, $author_name = NULL, $author_url = NULL, $cache_age = NULL, $thumbnail_url = NULL, $thumbnail_width = NULL, $thumbnail_height = NULL) {
if (empty($url)) { if (empty($url)) {
throw new \InvalidArgumentException('Photo resources must provide a URL.'); throw new \InvalidArgumentException('Photo resources must provide a URL.');
} }
...@@ -280,7 +280,7 @@ public static function photo($url, $width, $height, Provider $provider = NULL, $ ...@@ -280,7 +280,7 @@ public static function photo($url, $width, $height, Provider $provider = NULL, $
* @param int $width * @param int $width
* The width of the resource, in pixels. * The width of the resource, in pixels.
* @param int $height * @param int $height
* The height of the resource, in pixels. * (optional) The height of the resource, in pixels.
* @param \Drupal\media\OEmbed\Provider $provider * @param \Drupal\media\OEmbed\Provider $provider
* (optional) The resource provider. * (optional) The resource provider.
* @param string $title * @param string $title
...@@ -304,7 +304,7 @@ public static function photo($url, $width, $height, Provider $provider = NULL, $ ...@@ -304,7 +304,7 @@ public static function photo($url, $width, $height, Provider $provider = NULL, $
* *
* @return static * @return static
*/ */
public static function rich($html, $width, $height, Provider $provider = NULL, $title = NULL, $author_name = NULL, $author_url = NULL, $cache_age = NULL, $thumbnail_url = NULL, $thumbnail_width = NULL, $thumbnail_height = NULL) { public static function rich($html, $width, $height = NULL, Provider $provider = NULL, $title = NULL, $author_name = NULL, $author_url = NULL, $cache_age = NULL, $thumbnail_url = NULL, $thumbnail_width = NULL, $thumbnail_height = NULL) {
if (empty($html)) { if (empty($html)) {
throw new \InvalidArgumentException('The resource must provide an HTML representation.'); throw new \InvalidArgumentException('The resource must provide an HTML representation.');
} }
...@@ -325,7 +325,7 @@ public static function rich($html, $width, $height, Provider $provider = NULL, $ ...@@ -325,7 +325,7 @@ public static function rich($html, $width, $height, Provider $provider = NULL, $
* @param int $width * @param int $width
* The width of the video, in pixels. * The width of the video, in pixels.
* @param int $height * @param int $height
* The height of the video, in pixels. * (optional) The height of the video, in pixels.
* @param \Drupal\media\OEmbed\Provider $provider * @param \Drupal\media\OEmbed\Provider $provider
* (optional) The resource provider. * (optional) The resource provider.
* @param string $title * @param string $title
...@@ -349,7 +349,7 @@ public static function rich($html, $width, $height, Provider $provider = NULL, $ ...@@ -349,7 +349,7 @@ public static function rich($html, $width, $height, Provider $provider = NULL, $
* *
* @return static * @return static
*/ */
public static function video($html, $width, $height, Provider $provider = NULL, $title = NULL, $author_name = NULL, $author_url = NULL, $cache_age = NULL, $thumbnail_url = NULL, $thumbnail_width = NULL, $thumbnail_height = NULL) { public static function video($html, $width, $height = NULL, Provider $provider = NULL, $title = NULL, $author_name = NULL, $author_url = NULL, $cache_age = NULL, $thumbnail_url = NULL, $thumbnail_width = NULL, $thumbnail_height = NULL) {
$resource = static::rich($html, $width, $height, $provider, $title, $author_name, $author_url, $cache_age, $thumbnail_url, $thumbnail_width, $thumbnail_height); $resource = static::rich($html, $width, $height, $provider, $title, $author_name, $author_url, $cache_age, $thumbnail_url, $thumbnail_width, $thumbnail_height);
$resource->type = self::TYPE_VIDEO; $resource->type = self::TYPE_VIDEO;
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
"author_url": "https:\/\/twitter.com\/drupaldevdays", "author_url": "https:\/\/twitter.com\/drupaldevdays",
"html": "<h1>By the power of Grayskull, Twitter works!</h1>", "html": "<h1>By the power of Grayskull, Twitter works!</h1>",
"width": 550, "width": 550,
"height": 360, "height": null,
"type": "rich", "type": "rich",
"cache_age": "3153600000", "cache_age": "3153600000",
"provider_name": "Twitter", "provider_name": "Twitter",
......
...@@ -98,7 +98,11 @@ public function providerRender() { ...@@ -98,7 +98,11 @@ public function providerRender() {
'tweet' => [ 'tweet' => [
'https://twitter.com/drupaldevdays/status/935643039741202432', 'https://twitter.com/drupaldevdays/status/935643039741202432',
'rich_twitter.json', 'rich_twitter.json',
[], [
// The tweet resource does not specify a height, so the formatter
// should default to the configured maximum height.
'max_height' => 360,
],
[ [
'iframe' => [ 'iframe' => [
'src' => '/media/oembed?url=https%3A//twitter.com/drupaldevdays/status/935643039741202432', 'src' => '/media/oembed?url=https%3A//twitter.com/drupaldevdays/status/935643039741202432',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment