Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
hi,
i've added a video embed field to my node type.
When i preview this node type before submitting, the video embed field is missing information.
In the full node view mode the following data is present for the video embed field:
array (size=1)
0 =>
array (size=5)
'video_url' => string 'http://www.youtube.com/watch?v=IEng60LouQo' (length=42)
'thumbnail_path' => string 'public://video_embed_field_thumbnails/youtube/IEng60LouQo.jpg' (length=61)
'video_data' => string 'a:22:{s:5:"xmlns";s:27:"http://www.w3.org/2005/Atom";s:8:"xmlns$gd";s:32:"http://schemas.google.com/g/2005";s:8:"xmlns$yt";s:37:"http://gdata.youtube.com/schemas/2007";s:11:"xmlns$media";s:29:"http://search.yahoo.com/mrss/";s:7:"gd$etag";s:28:"W/"A0ECSX47eCp7I2A9XRdREk4."";s:2:"id";s:38:"tag:youtube.com,2008:video:IEng60LouQo";s:9:"published";s:24:"2013-03-15T16:37:46.000Z";s:7:"updated";s:24:"2014-10-02T08:47:48.000Z";s:8:"category";a:2:{i:0;a:2:{s:6:"scheme";s:37:"http://schemas.google.com/g/2005#kind";s:'... (length=6037)
'embed_code' => null
'description' => null
In preview mode, there's only the following data:
array (size=1)
0 =>
array (size=1)
'video_url' => string 'http://www.youtube.com/watch?v=IEng60LouQo' (length=42)
Comments
Comment #1
aTrotter CreditAttribution: aTrotter commentedComment #2
plopescHello
Some of the data is generated in
hook_field_presave()
, which is not executed until you press the 'Save' button. That the reason why not all the data is available when you're previewing the node before saving the field content.Regards