• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Fixed Undefined offset: 1

teletubbi

Well-known member
#1
Had today a lot of this error messages from different users.
Xenforo 1.5.1
Xenmedia 1.1.1

Any clue?

ErrorException: Undefined offset: 1 - library/XenGallery/Model/Media.php:1083
Generiert durch: Hooker, Heute um 12:41 Uhr
Stapelverfolgung
#0 /var/www/html/pattayaforum.net/www/forums/library/XenGallery/Model/Media.php(1083): XenForo_Application::handlePhpError(8, 'Undefined offse...', '/var/www/html/p...', 1083, Array)
#1 /var/www/html/pattayaforum.net/www/forums/library/XenGallery/ControllerHelper/Media.php(203): XenGallery_Model_Media->prepareMedia(Array)
#2 /var/www/html/pattayaforum.net/www/forums/library/XenGallery/ControllerPublic/Media.php(176): XenGallery_ControllerHelper_Media->assertMediaValidAndViewable(367246, Array)
#3 /var/www/html/pattayaforum.net/www/forums/library/XenForo/FrontController.php(351): XenGallery_ControllerPublic_Media->actionView()
#4 /var/www/html/pattayaforum.net/www/forums/library/XenForo/FrontController.php(134): XenForo_FrontController->dispatch(Object(XenForo_RouteMatch))
#5 /var/www/html/pattayaforum.net/www/forums/index.php(13): XenForo_FrontController->run()
#6 {main}
Benötigter Status
array(3) {
["url"] => string(57) "http://www.pattayaforum.net/forums/media/facebook. Xxx/"
["_GET"] => array(0) {
}
["_POST"] => array(0) {
}
}
 

Chris D

XenForo developer
Staff member
#4
How did I miss that? :)

I think this relates to an embedded video.

Could you let me know the result of this database query?
Code:
SELECT media_tag
FROM xengallery_media
WHERE media_id = Xxx
Change Xxx to whatever the media ID is for that media (the same number you replaced in the error output in your post)
 

teletubbi

Well-known member
#6
Hi @Chris,
i got this:

Screenshot_1.jpg

Digging into more of this error messages i found some had also gfnnotify include like this.

ErrorException: Undefined offset: 1 - library/XenGallery/Model/Media.php:1083
Generiert durch: pepper_chilli, Gestern um 14:53 Uhr
Stapelverfolgung
#0 /var/www/html/pattayaforum.net/www/forums/library/XenGallery/Model/Media.php(1083): XenForo_Application::handlePhpError(8, 'Undefined offse...', '/var/www/html/p...', 1083, Array)
#1 /var/www/html/pattayaforum.net/www/forums/library/XenGallery/AlertHandler/Media.php(37): XenGallery_Model_Media->prepareMedia(Array)
#2 /var/www/html/pattayaforum.net/www/forums/library/XenForo/Model/Alert.php(234): XenGallery_AlertHandler_Media->getContentByIds(Array, Object(bdTagMe_XenForo_Model_Alert), 1967, Array)
#3 /var/www/html/pattayaforum.net/www/forums/library/XenForo/Model/Alert.php(77): XenForo_Model_Alert->_getContentForAlerts(Array, 1967, Array)
#4 /var/www/html/pattayaforum.net/www/forums/library/GFNNotify/ControllerPublic/Notify.php(64): XenForo_Model_Alert->getAlertsForUser(1967, 'fetchAll')
#5 /var/www/html/pattayaforum.net/www/forums/library/XenForo/FrontController.php(351): GFNNotify_ControllerPublic_Notify->actionGetNotifications()
#6 /var/www/html/pattayaforum.net/www/forums/library/XenForo/FrontController.php(134): XenForo_FrontController->dispatch(Object(XenForo_RouteMatch))
#7 /var/www/html/pattayaforum.net/www/forums/index.php(13): XenForo_FrontController->run()
#8 {main}
Benötigter Status
array(3) {
["url"] => string(62) "http://www.pattayaforum.net/forums/gfnnotify/get-notifications"
["_GET"] => array(0) {
}
["_POST"] => array(4) {
["_xfRequestUri"] => string(24) "/forums/threads/featured"
["_xfNoRedirect"] => string(1) "1"
["_xfToken"] => string(8) "********"
["_xfResponseType"] => string(4) "json"
}
}


Another one have only alert-popup.

ErrorException: Undefined offset: 1 - library/XenGallery/Model/Media.php:1083
Generiert durch: pepper_chilli, Gestern um 21:26 Uhr
Stapelverfolgung
#0 /var/www/html/pattayaforum.net/www/forums/library/XenGallery/Model/Media.php(1083): XenForo_Application::handlePhpError(8, 'Undefined offse...', '/var/www/html/p...', 1083, Array)
#1 /var/www/html/pattayaforum.net/www/forums/library/XenGallery/AlertHandler/Media.php(37): XenGallery_Model_Media->prepareMedia(Array)
#2 /var/www/html/pattayaforum.net/www/forums/library/XenForo/Model/Alert.php(234): XenGallery_AlertHandler_Media->getContentByIds(Array, Object(bdTagMe_XenForo_Model_Alert), 1967, Array)
#3 /var/www/html/pattayaforum.net/www/forums/library/XenForo/Model/Alert.php(77): XenForo_Model_Alert->_getContentForAlerts(Array, 1967, Array)
#4 /var/www/html/pattayaforum.net/www/forums/library/XenForo/ControllerPublic/Account.php(75): XenForo_Model_Alert->getAlertsForUser(1967, 'fetchPopupItems')
#5 /var/www/html/pattayaforum.net/www/forums/library/XenForo/FrontController.php(351): XenForo_ControllerPublic_Account->actionAlertsPopup()
#6 /var/www/html/pattayaforum.net/www/forums/library/XenForo/FrontController.php(134): XenForo_FrontController->dispatch(Object(XenForo_RouteMatch))
#7 /var/www/html/pattayaforum.net/www/forums/index.php(13): XenForo_FrontController->run()
#8 {main}
Benötigter Status
array(3) {
["url"] => string(55) "http://www.pattayaforum.net/forums/account/alerts-popup"
["_GET"] => array(0) {
}
["_POST"] => array(0) {
}
}
I disabled gfnnotify but the error messages continue with the last one.

Have now already about 15 pages with this messages. Start suddenly yesterday. Nothing was changed.
No update, no new installation. Running since i update to 15.1.1 and 1.1.1 without any problems. This message was never seen before. So i am wondering why this happens just out of the blue.

I am not sure if it is related to mediagallery or xenforo itself. I wrote here because always Media.php was mentioned.
 

estranged

Well-known member
#7
Hello,

Seeing lots of these in error log. It has started after upgrading to 1.5.5

Thanks.

Code:
ErrorException: Undefined offset: 1 - library/XenGallery/Model/Media.php:1094
Oluşturan: Bilinmeyen Hesap, Bugün: 08:40
Yığın İzleme
#0 /home/x/public_html/library/XenGallery/Model/Media.php(1094): XenForo_Application::handlePhpError(8, 'Undefined offse...', '/home/x/...', 1094, Array)
#1 /home/x/public_html/library/XenGallery/Model/Media.php(1158): XenGallery_Model_Media->prepareMedia(Array)
#2 /home/x/public_html/library/XenGallery/ControllerPublic/User.php(158): XenGallery_Model_Media->prepareMediaItems(Array)
#3 /home/x/public_html/library/XenForo/FrontController.php(351): XenGallery_ControllerPublic_User->actionContent()
#4 /home/xpublic_html/library/XenForo/FrontController.php(134): XenForo_FrontController->dispatch(Object(XenForo_RouteMatch))
#5 /home/x/public_html/index.php(13): XenForo_FrontController->run()
#6 {main}
Request State
array(3) {
  ["url"] => string(69) "http://x/medya/uye/102069/?order=view_count&container=site"
  ["_GET"] => array(2) {
    ["order"] => string(10) "view_count"
    ["container"] => string(4) "site"
  }
  ["_POST"] => array(0) {
  }
}
and

Code:
ErrorException: Undefined offset: 2 - library/XenGallery/Model/Media.php:1094
Oluşturan: Bilinmeyen Hesap, Bugün: 08:40
Yığın İzleme
#0 /home/x/public_html/library/XenGallery/Model/Media.php(1094): XenForo_Application::handlePhpError(8, 'Undefined offse...', '/home/x/...', 1094, Array)
#1 /home/x/public_html/library/XenGallery/Model/Media.php(1158): XenGallery_Model_Media->prepareMedia(Array)
#2 /home/x/public_html/library/XenGallery/ControllerPublic/User.php(158): XenGallery_Model_Media->prepareMediaItems(Array)
#3 /home/x/public_html/library/XenForo/FrontController.php(351): XenGallery_ControllerPublic_User->actionContent()
#4 /home/x/public_html/library/XenForo/FrontController.php(134): XenForo_FrontController->dispatch(Object(XenForo_RouteMatch))
#5 /home/x/public_html/index.php(13): XenForo_FrontController->run()
#6 {main}
Request State
array(3) {
  ["url"] => string(69) "http://x/medya/uye/102069/?order=view_count&container=site"
  ["_GET"] => array(2) {
    ["order"] => string(10) "view_count"
    ["container"] => string(4) "site"
  }
  ["_POST"] => array(0) {
  }
}
 

Chris D

XenForo developer
Staff member
#8
This is a duplicate report but could you submit a ticket from your customer area preferably with Admin CP, FTP and PhpMyAdmin access? I would like to investigate further.

@teletubbi if you could do the same that may be useful.

Thanks.
 

Chris D

XenForo developer
Staff member
#9
Hello,

Seeing lots of these in error log. It has started after upgrading to 1.5.5

Thanks.

Code:
ErrorException: Undefined offset: 1 - library/XenGallery/Model/Media.php:1094
Oluşturan: Bilinmeyen Hesap, Bugün: 08:40
Yığın İzleme
#0 /home/x/public_html/library/XenGallery/Model/Media.php(1094): XenForo_Application::handlePhpError(8, 'Undefined offse...', '/home/x/...', 1094, Array)
#1 /home/x/public_html/library/XenGallery/Model/Media.php(1158): XenGallery_Model_Media->prepareMedia(Array)
#2 /home/x/public_html/library/XenGallery/ControllerPublic/User.php(158): XenGallery_Model_Media->prepareMediaItems(Array)
#3 /home/x/public_html/library/XenForo/FrontController.php(351): XenGallery_ControllerPublic_User->actionContent()
#4 /home/xpublic_html/library/XenForo/FrontController.php(134): XenForo_FrontController->dispatch(Object(XenForo_RouteMatch))
#5 /home/x/public_html/index.php(13): XenForo_FrontController->run()
#6 {main}
Request State
array(3) {
  ["url"] => string(69) "http://x/medya/uye/102069/?order=view_count&container=site"
  ["_GET"] => array(2) {
    ["order"] => string(10) "view_count"
    ["container"] => string(4) "site"
  }
  ["_POST"] => array(0) {
  }
}
and

Code:
ErrorException: Undefined offset: 2 - library/XenGallery/Model/Media.php:1094
Oluşturan: Bilinmeyen Hesap, Bugün: 08:40
Yığın İzleme
#0 /home/x/public_html/library/XenGallery/Model/Media.php(1094): XenForo_Application::handlePhpError(8, 'Undefined offse...', '/home/x/...', 1094, Array)
#1 /home/x/public_html/library/XenGallery/Model/Media.php(1158): XenGallery_Model_Media->prepareMedia(Array)
#2 /home/x/public_html/library/XenGallery/ControllerPublic/User.php(158): XenGallery_Model_Media->prepareMediaItems(Array)
#3 /home/x/public_html/library/XenForo/FrontController.php(351): XenGallery_ControllerPublic_User->actionContent()
#4 /home/x/public_html/library/XenForo/FrontController.php(134): XenForo_FrontController->dispatch(Object(XenForo_RouteMatch))
#5 /home/x/public_html/index.php(13): XenForo_FrontController->run()
#6 {main}
Request State
array(3) {
  ["url"] => string(69) "http://x/medya/uye/102069/?order=view_count&container=site"
  ["_GET"] => array(2) {
    ["order"] => string(10) "view_count"
    ["container"] => string(4) "site"
  }
  ["_POST"] => array(0) {
  }
}
@teletubbi is experiencing something similar and a ticket was submitted with access.

This has been somewhat useful, and I've been able to workaround the issue, but it has posed more questions than answers. @estranged if you can submit a ticket with access to at least the Admin CP and database that would be great.

Thanks.
 

estranged

Well-known member
#10
I had noticed this was happening when visiting the media of one specific user so I checked it and looks like that user had edited the media url to something non-url. Since then I had deleted that media and not having the problem anymore.

Thank you.
 

Chris D

XenForo developer
Staff member
#11
Ok, thanks.

That's sort of consistent with what was happening at teletubbi's site.

We'll get this fixed, thanks.