Forum
YouTube Field Set Errors
I seem to be experiencing issues with my YouTube field set... I'm using PHP 7 and the following errors throw up. Degbug, Diagnostics Report, Code is all below. Any idea why this is happening?
The Field
<perch:content id="video" type="youtube" width="1280" label="YouTube URL" output="embed" order="17" />
The Errors
( ! ) Notice: Undefined index: width in /Users/danlee/Sites/Work/armstrong/login/addons/fieldtypes/youtube/youtube.class.php on line 113
Call Stack
# Time Memory Function Location
1 0.0003 379424 {main}( ) .../start.php:0
2 0.1677 3292192 include( '/Users/danlee/Sites/Work/armstrong/login/templates/pages/tech/tech.php' ) .../start.php:32
3 0.1678 3292760 perch_collection( ) .../tech.php:19
4 0.1678 3292760 PerchContent_Runway->get_collection( ) .../runtime.php:36
5 0.2456 3477136 PerchTemplate->render_group( ) .../PerchContent_Runway.class.php:467
6 0.2459 3489816 PerchTemplate->render( ) .../PerchTemplate.class.php:105
7 0.2530 3539632 PerchTemplate->replace_content_tags( ) .../PerchTemplate.class.php:190
8 0.2548 3630816 PerchFieldType_youtube->get_processed( ) .../PerchTemplate.class.php:311
( ! ) Notice: Undefined index: height in /Users/danlee/Sites/Work/armstrong/login/addons/fieldtypes/youtube/youtube.class.php on line 114
Call Stack
# Time Memory Function Location
1 0.0003 379424 {main}( ) .../start.php:0
2 0.1677 3292192 include( '/Users/danlee/Sites/Work/armstrong/login/templates/pages/tech/tech.php' ) .../start.php:32
3 0.1678 3292760 perch_collection( ) .../tech.php:19
4 0.1678 3292760 PerchContent_Runway->get_collection( ) .../runtime.php:36
5 0.2456 3477136 PerchTemplate->render_group( ) .../PerchContent_Runway.class.php:467
6 0.2459 3489816 PerchTemplate->render( ) .../PerchTemplate.class.php:105
7 0.2530 3539632 PerchTemplate->replace_content_tags( ) .../PerchTemplate.class.php:190
8 0.2548 3630816 PerchFieldType_youtube->get_processed( ) .../PerchTemplate.class.php:311
( ! ) Notice: Undefined index: height in /Users/danlee/Sites/Work/armstrong/login/addons/fieldtypes/youtube/youtube.class.php on line 123
Call Stack
# Time Memory Function Location
1 0.0003 379424 {main}( ) .../start.php:0
2 0.1677 3292192 include( '/Users/danlee/Sites/Work/armstrong/login/templates/pages/tech/tech.php' ) .../start.php:32
3 0.1678 3292760 perch_collection( ) .../tech.php:19
4 0.1678 3292760 PerchContent_Runway->get_collection( ) .../runtime.php:36
5 0.2456 3477136 PerchTemplate->render_group( ) .../PerchContent_Runway.class.php:467
6 0.2459 3489816 PerchTemplate->render( ) .../PerchTemplate.class.php:105
7 0.2530 3539632 PerchTemplate->replace_content_tags( ) .../PerchTemplate.class.php:190
8 0.2548 3630816 PerchFieldType_youtube->get_processed( ) .../PerchTemplate.class.php:311
( ! ) Notice: Undefined index: width in /Users/danlee/Sites/Work/armstrong/login/addons/fieldtypes/youtube/youtube.class.php on line 123
Call Stack
# Time Memory Function Location
1 0.0003 379424 {main}( ) .../start.php:0
2 0.1677 3292192 include( '/Users/danlee/Sites/Work/armstrong/login/templates/pages/tech/tech.php' ) .../start.php:32
3 0.1678 3292760 perch_collection( ) .../tech.php:19
4 0.1678 3292760 PerchContent_Runway->get_collection( ) .../runtime.php:36
5 0.2456 3477136 PerchTemplate->render_group( ) .../PerchContent_Runway.class.php:467
6 0.2459 3489816 PerchTemplate->render( ) .../PerchTemplate.class.php:105
7 0.2530 3539632 PerchTemplate->replace_content_tags( ) .../PerchTemplate.class.php:190
8 0.2548 3630816 PerchFieldType_youtube->get_processed( ) .../PerchTemplate.class.php:311
( ! ) Warning: Division by zero in /Users/danlee/Sites/Work/armstrong/login/addons/fieldtypes/youtube/youtube.class.php on line 123
Call Stack
# Time Memory Function Location
1 0.0003 379424 {main}( ) .../start.php:0
2 0.1677 3292192 include( '/Users/danlee/Sites/Work/armstrong/login/templates/pages/tech/tech.php' ) .../start.php:32
3 0.1678 3292760 perch_collection( ) .../tech.php:19
4 0.1678 3292760 PerchContent_Runway->get_collection( ) .../runtime.php:36
5 0.2456 3477136 PerchTemplate->render_group( ) .../PerchContent_Runway.class.php:467
6 0.2459 3489816 PerchTemplate->render( ) .../PerchTemplate.class.php:105
7 0.2530 3539632 PerchTemplate->replace_content_tags( ) .../PerchTemplate.class.php:190
8 0.2548 3630816 PerchFieldType_youtube->get_processed( ) .../PerchTemplate.class.php:311
Debug Message
[60] SELECT p.pagePath, pr.routePattern, pr.routeRegExp, p.pageTemplate FROM perch2_pages p LEFT JOIN perch2_page_routes pr ON p.pageID=pr.pageID ORDER BY pr.routeOrder ASC, p.pagePath ASC
Matched route: technologies/[slug:s]
Using master page: /templates/pages/tech/tech.php
Page arguments:
Array
(
[0] => /technologies/biologics
[s] => biologics
[1] => biologics
)
[1] SELECT * FROM perch2_pages WHERE pagePath='/technologies' LIMIT 1
[1] SELECT collectionID, collectionTemplate FROM perch2_collections WHERE collectionKey='Technology'
[1] SELECT * FROM ( SELECT idx.itemID, ci.collectionID, ci.itemJSON, idx2.indexValue as sortval FROM perch2_collection_index idx JOIN perch2_collection_items ci ON idx.itemID=ci.itemID AND idx.itemRev=ci.itemRev AND idx.collectionID=ci.collectionID JOIN perch2_collection_revisions cr ON idx.itemID=cr.itemID AND idx.itemRev=cr.itemRev AND idx.collectionID=ci.collectionID JOIN perch2_collection_index idx2 ON idx.itemID=idx2.itemID AND idx.itemRev=idx2.itemRev AND idx2.indexKey='_order' WHERE (idx.collectionID=3) AND ((idx.indexKey='slug' AND idx.indexValue='biologics')) AND idx.itemID=idx2.itemID AND idx.itemRev=idx2.itemRev ) as tbl GROUP BY itemID, itemJSON, sortval ORDER BY sortval ASC
Using template: /templates/content/tech/tech.html
Using sub-template: /templates/content/global.html
Using sub-template: /templates/content/tech/_global.html
Using sub-template: /templates/content/tech/_sidebar_menu.html
Using sub-template: /templates/content/tech/_mobile_menu.html
[1] Using sub-template: /templates/content/tech/_mobile_page_end.html
Using sub-template: /templates/content/tech/_menu_items.html
Requested sub-template not found: /Users/danlee/Sites/Work/armstrong/login/templates/content/tech/content/global/newsletter.html
Using sub-template: /templates/content/tech/_menu_items.html
Using sub-template: /templates/content/tech/_menu_items.html
[8] Requested sub-template not found: /Users/danlee/Sites/Work/armstrong/login/templates/content/tech/content/global/newsletter.html
Requested sub-template not found: /Users/danlee/Sites/Work/armstrong/login/templates/content/tech/content/global/newsletter.html
Using template: /templates/pages/attributes/default.html
Using sub-template: /templates/pages/attributes/seo.html
Using sub-template: /templates/pages/attributes/facebook.html
Using sub-template: /templates/pages/attributes/twitter.html
Using sub-template: /templates/pages/attributes/article.html
[1] SELECT * FROM ( SELECT idx.itemID, ci.collectionID, ci.itemJSON, idx2.indexValue as sortval FROM perch2_collection_index idx JOIN perch2_collection_items ci ON idx.itemID=ci.itemID AND idx.itemRev=ci.itemRev AND idx.collectionID=ci.collectionID JOIN perch2_collection_revisions cr ON idx.itemID=cr.itemID AND idx.itemRev=cr.itemRev AND idx.collectionID=ci.collectionID JOIN perch2_collection_index idx2 ON idx.itemID=idx2.itemID AND idx.itemRev=idx2.itemRev AND idx2.indexKey='title' WHERE (idx.collectionID=3) AND ((idx.indexKey='hide' AND idx.indexValue != 'true')) AND idx.itemID=idx2.itemID AND idx.itemRev=idx2.itemRev ) as tbl GROUP BY itemID, itemJSON, sortval ORDER BY sortval ASC
[1] Using template: /templates/content/tech/_tech_menu.html
[1] SELECT regionKey, regionHTML FROM perch2_content_regions WHERE regionPage='/technologies' OR regionPage='*' ORDER BY regionPage DESC
[1] SELECT regionID, regionTemplate, regionPage, regionRev AS rev FROM perch2_content_regions WHERE regionKey='Feedback' AND (regionPage='/technologies' OR regionPage='*')
[1] SELECT * FROM ( SELECT idx.itemID, c.regionID, idx.pageID, c.itemJSON, idx2.indexValue as sortval FROM perch2_content_index idx JOIN perch2_content_items c ON idx.itemID=c.itemID AND idx.itemRev=c.itemRev AND idx.regionID=c.regionID JOIN perch2_content_index idx2 ON idx.itemID=idx2.itemID AND idx.itemRev=idx2.itemRev AND idx2.indexKey='_order' WHERE ((idx.regionID=4 AND idx.itemRev=3)) AND idx.itemID=idx2.itemID AND idx.itemRev=idx2.itemRev ) as tbl GROUP BY itemID, pageID, itemJSON, sortval ORDER BY sortval ASC
[1] Using template: /templates/content/global/_feedback.html
Using sub-template: /templates/content/global/_feedback_form.html
Request time: 0.3805
Process time: 0.3792
Memory: 3.8259
Array
(
[type] => 2
[message] => Division by zero
[file] => /Users/danlee/Sites/Work/armstrong/login/addons/fieldtypes/youtube/youtube.class.php
[line] => 123
)
Diagnostics
Perch Runway: 2.8.34
Production mode: Production (100)
Installed apps: content (2.8.34), assets (2.8.34), categories (2.8.34), collection_5 (2.8.34), collection_2 (2.8.34), collection_1 (2.8.34), collection_9 (2.8.34), collection_6 (2.8.34), collection_11 (2.8.34), perch_forms (1.8.3), collection_12 (2.8.34), collection_4 (2.8.34), collection_10 (2.8.34), collection_13 (2.8.34), collection_8 (2.8.34), collection_3 (2.8.34), collection_7 (2.8.34), perch_members (1.5)
DB driver: PDO
DB tables: perch2_backup_plans (0), perch2_backup_resources (0), perch2_backup_runs (0), perch2_categories (31), perch2_category_counts (0), perch2_category_sets (6), perch2_collection_index (41573), perch2_collection_items (703), perch2_collection_revisions (141), perch2_collections (13), perch2_content_index (784), perch2_content_items (153), perch2_content_regions (37), perch2_forms (2), perch2_forms_responses (68), perch2_members (0), perch2_members_forms (0), perch2_members_member_tags (0), perch2_members_sessions (0), perch2_members_tags (0), perch2_navigation (1), perch2_navigation_pages (5), perch2_page_routes (28), perch2_page_templates (58), perch2_pages (60), perch2_resource_log (6569), perch2_resource_tags (8), perch2_resources (1401), perch2_resources_to_tags (28), perch2_settings (33), perch2_shop_addresses (0), perch2_shop_admin_index (0), perch2_shop_brands (0), perch2_shop_cart (0), perch2_shop_cart_data (0), perch2_shop_cart_items (0), perch2_shop_countries (248), perch2_shop_currencies (152), perch2_shop_customers (0), perch2_shop_emails (1), perch2_shop_index (0), perch2_shop_option_values (0), perch2_shop_options (0), perch2_shop_order_items (0), perch2_shop_orders (0), perch2_shop_product_files (0), perch2_shop_product_option_values (0), perch2_shop_product_options (0), perch2_shop_product_tags (0), perch2_shop_products (0), perch2_shop_promotions (0), perch2_shop_search (0), perch2_shop_shippings (0), perch2_shop_tax_exhibits (0), perch2_shop_tax_group_rates (0), perch2_shop_tax_groups (0), perch2_shop_tax_locations (0), perch2_shop_tax_rates (0), perch2_shop_variants (0), perch2_user_passwords (5), perch2_user_privileges (33), perch2_user_role_privileges (18), perch2_user_roles (3), perch2_users (9)
Users: 9
PHPMailer: 5.2.21
App runtimes:
<?php
$apps_list = array(
'content',
'categories',
'perch_members',
'perch_forms',
);
Editor plug-ins: markitup
H1: 509805ffec8547456676464bb77923b6
L1: 4043fa6928ca675d97aec002d2d870e5
F1: 6a33f95eca3667f9e0c39bf5ca2980fe
headerColour: #000000
content_singlePageEdit: 1
helpURL:
hideBranding: 1
content_collapseList: 1
lang: en-gb
update_2.8.13: done
update_runway_2.8.15: done
headerScheme: dark
update_runway_2.8.13: done
latest_version: 2.8.15
on_sale_version: 2.8.34
dashboard: 1
hide_pwd_reset: 0
content_hideNonEditableRegions: 0
content_frontend_edit: 0
siteURL: /
update_runway_2.8.17: done
update_runway_2.8.18: done
update_runway_2.8.23: done
perch_shop_update: g10
perch_members_update: 1.4
update_runway_2.8.24: done
update_runway_2.8.25: done
update_runway_2.8.26: done
update_runway_2.8.29: done
update_runway_2.8.31: done
update_runway_2.8.34: done
perch_members_login_page: /members/login.php?r={returnURL}
PERCH_DEVELOPMENT: 10
PERCH_STAGING: 50
PERCH_PRODUCTION: 100
PERCH_SCHEDULE_SECRET: 3zusF5zHjpqi6Yyi
PERCH_SITEPATH: /Users/danlee/Sites/Work/armstrong
PERCH_DB_USERNAME: armstron_cpi
PERCH_DB_SERVER: 185.119.174.157
PERCH_DB_DATABASE: armstron_admin_cpi_armstrong_dev
PERCH_DB_PREFIX: perch2_
PERCH_EMAIL_FROM: info@uk-cpi.com
PERCH_EMAIL_FROM_NAME: CPI
PERCH_LOGINPATH: /login
PERCH_PATH: /Users/danlee/Sites/Work/armstrong/login
PERCH_CORE: /Users/danlee/Sites/Work/armstrong/login/core
PERCH_RESFILEPATH: /Users/danlee/Sites/Work/armstrong/login/resources
PERCH_RESPATH: /login/resources
PERCH_HTML5: 1
PERCH_TZ: Europe/London
PERCH_EMAIL_METHOD: mail
PERCH_YOUTUBE_API_KEY: AIzaSyABObR78cRpeVORGJkYkKEAclJodKiURcE
PERCH_GMAPS_API_KEY: AIzaSyCd5Gr9pQ-SA7XuYkG7CS9dqXzdpfRfG0I
PERCH_RWD: 1
PERCH_DEBUG: 1
PERCH_RUNWAY: 1
PERCH_ERROR_MODE: DIE
PERCH_DATE_LONG: %d %B %Y
PERCH_DATE_SHORT: %d %b %Y
PERCH_TIME_SHORT: %H:%M
PERCH_TIME_LONG: %H:%M:%S
PERCH_RUNWAY_ROUTED:
PERCH_STRONG_PASSWORDS:
PERCH_PREVIEW_ARG: preview
PERCH_TEMPLATE_PATH: /Users/danlee/Sites/Work/armstrong/login/templates
PERCH_DEFAULT_DOC: index.php
PERCH_DEFAULT_EXT: .php
PERCH_PRODUCTION_MODE: 100
PERCH_HTML_ENTITIES:
PERCH_SSL:
PERCH_STRIPSLASHES:
PERCH_PROGRESSIVE_FLUSH: 1
PERCH_PARANOID:
PERCH_FORCE_SECURE_COOKIES:
PERCH_PASSWORD_MIN_LENGTH: 6
PERCH_MAX_FAILED_LOGINS: 10
PERCH_AUTH_LOCKOUT_DURATION: 1 HOUR
PERCH_VERIFY_UPLOADS:
PERCH_AUTH_PLUGIN:
PERCH_DB_CHARSET: utf8
PERCH_DB_PORT:
PERCH_DB_SOCKET:
PERCH_SESSION_TIMEOUT_MINS: 20
HOSTING SETTINGS
PHP: 7.0.11
Zend: 3.0.0
OS: Darwin
SAPI: apache2handler
Safe mode: not detected
MySQL client: mysqlnd 5.0.12-dev - 20150407 - $Id: 241ae00989d1995ffcbbf63d579943635faf9972 $
MySQL server: 5.6.34-log
Free disk space: 606.39 GB
Extensions: Core, date, libxml, openssl, pcre, sqlite3, zlib, bcmath, bz2, calendar, ctype, dom, hash, fileinfo, filter, ftp, gd, gettext, SPL, iconv, json, ldap, mbstring, session, standard, mysqlnd, PDO, pdo_mysql, pdo_sqlite, Phar, posix, Reflection, mysqli, shmop, SimpleXML, soap, sockets, exif, sysvmsg, sysvsem, sysvshm, tidy, tokenizer, wddx, xml, xmlreader, xmlrpc, xmlwriter, zip, apache2handler, apcu, curl, gmp, imap, intl, mcrypt, pdo_pgsql, pgsql, propro, raphf, readline, xsl, http, Zend OPcache, xdebug
GD: Yes
ImageMagick: No
PHP max upload size: 50M
PHP max form post size: 60M
PHP memory limit: 256M
Total max uploadable file size: 50M
Resource folder writeable: Yes
Session timeout: 240 minutes
Native JSON: Yes
Filter functions: Yes
Transliteration functions: Yes
HTTP_HOST: armstrong.dev
HTTP_CONNECTION: keep-alive
HTTP_UPGRADE_INSECURE_REQUESTS: 1
HTTP_USER_AGENT: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.95 Safari/537.36
HTTP_ACCEPT: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
HTTP_REFERER: https://armstrong.dev/login/core/settings/diagnostics/
HTTP_ACCEPT_ENCODING: gzip, deflate, sdch
HTTP_ACCEPT_LANGUAGE: en-US,en;q=0.8
HTTP_COOKIE: cmsa=1; _gat_UA-2415452-6=1; _ga=GA1.2.128790519.1485507422; _gat=1; __atuvc=19%7C4; __atuvs=588b0b5ef73848f8012; PHPSESSID=0v2o0n5o6keckh90su1f1km4d7
PATH: /usr/bin:/bin:/usr/sbin:/sbin
SERVER_SOFTWARE: Apache/2.4.10 (Unix) PHP/7.0.11
SERVER_NAME: armstrong.dev
SERVER_ADDR: 127.0.0.1
SERVER_PORT: 80
REMOTE_ADDR: 127.0.0.1
DOCUMENT_ROOT: /Users/danlee/Sites/Work/armstrong
REQUEST_SCHEME: http
CONTEXT_DOCUMENT_ROOT: /Users/danlee/Sites/Work/armstrong
SERVER_ADMIN: you@example.com
SCRIPT_FILENAME: /Users/danlee/Sites/Work/armstrong/login/core/settings/diagnostics/index.php
REMOTE_PORT: 56583
GATEWAY_INTERFACE: CGI/1.1
SERVER_PROTOCOL: HTTP/1.1
REQUEST_METHOD: GET
QUERY_STRING: extended
REQUEST_URI: /login/core/settings/diagnostics/?extended
SCRIPT_NAME: /login/core/settings/diagnostics/index.php
PHP_SELF: /login/core/settings/diagnostics/index.php
REQUEST_TIME_FLOAT: 1485509511.698
REQUEST_TIME: 1485509511
The video data coming back from the YouTube API has no width.
Do you see the YouTube response in the debug when saving the form?
This is the debug when I save the Collection item.
It's weird, the same video is working perfectly for me here.
The video plays fine for me too - I just get the errors.
When I remove width from the field set code I get a different debug message.
Where do you get the errors?
Above the <!DOCTYPE html> - so at the top of the page
Are you on the current version?
Yes I am. Latest version for both Perch Runway and YouTube Field Set
Ok. So for me it works, for you it errors. What's different?
It might be an issue with my local environment - seems fine on the staging server.