Forum

Thread tagged as: Problem, Error, Field-Types

YouTube field type issues

Hello,

I've been trying to work with the youtube fieldtype for hours now and just can't seem to make it function correctly.

I am running the latest version of Perch, latest version of the Youtube fieldtype, and have updated my config file with my API key.

Here is my template:

<perch:content id="video" type="youtube" label="YouTube URL" />
<perch:content id="video" type="youtube" label="YouTube URL" output="id" />
<perch:content id="video" type="youtube" label="YouTube URL" output="embed" />
<perch:content id="video" type="youtube" label="YouTube URL" output="title" />
<perch:content id="video" type="youtube" label="YouTube URL" output="description" />

Very basic, as I am trying to test for what is working and what isn't. So far, only the first field, the id, and the embed are working, but the title and description are not.

Also, everytime I add a video I see the following error messages:

Notice: Undefined index: width in C:\xampp\htdocs\ihms2014\cms\addons\fieldtypes\youtube\youtube.class.php on line 113

Notice: Undefined index: height in C:\xampp\htdocs\ihms2014\cms\addons\fieldtypes\youtube\youtube.class.php on line 114

I don't see these errors come up if I eliminate the embed output.

Please help.

Thank you

Joshua Rodriguez

Joshua Rodriguez 2 points

  • 6 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Have you tried setting a width and height?

Hi Drew,

Yes, setting the width and height, or setting just the height, still shows me these two errors.

When I set the width only, I get the same two errors, plus the following error message:

Warning: Division by zero in C:\xampp\htdocs\ihms2014\cms\addons\fieldtypes\youtube\youtube.class.php on line 123

I'm thinking this may be a system related issue though. I'm running xampp on Windows 7, but I uploaded the files to the live site and then added a video. I don't see any errors in my error log on the live site, so maybe a system issue?

Drew McLellan

Drew McLellan 2638 points
Perch Support

Yes, it could be.