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

MG 1.1 Undefined Offset: 1 & Offset: 2

Discussion in 'Media Gallery Support' started by 51463, Mar 11, 2016.

  1. 51463

    51463 Well-Known Member

    I keep getting undefined offset1 and undefined offset2 errors,

    i thought it was add-on but someone told me it was media gallery



    Code:
    Error Info
    ErrorException: Undefined offset: 1 - library/XenGallery/Model/Media.php:1094
    Generated By: Unknown Account, Today at 8:03 AM
    Stack Trace
    #0 /home/forum/public_html/library/XenGallery/Model/Media.php(1094): XenForo_Application::handlePhpError(8, 'Undefined offse...', '/home/forum...', 1094, Array)
    #3 /home/forum/public_html/library/XenGallery/ControllerPublic/Media.php(51): XenGallery_Model_Media->prepareMediaItems(Array)
    #6 /home/forum/public_html/library/XenForo/FrontController.php(134): XenForo_FrontController->dispatch(Object(XenForo_RouteMatch))
    #7 /home/forum/public_html/index.php(13): XenForo_FrontController->run()
    #8 {main}
    Request State
    array(3) {
      ["url"] => string(69) "http://forum.com/media/?order=rating_weighted&type=site&page=2206"
      ["_GET"] => array(3) {
        ["order"] => string(15) "rating_weighted"
        ["type"] => string(4) "site"
        ["page"] => string(4) "2206"
      }
      ["_POST"] => array(0) {
      }
    }
    


    find
    Code:
    preg_match('/\[media=(.*?)\](.*?)\[\/media\]/is', $media['media_tag'], $parts);
    $media['mediaSite'] = "$parts[1].$parts[2]";
    $videoThumbnail = $this->getVideoThumbnailUrlFromParts($parts);
    $media['thumbnailUrl'] = $videoThumbnail;
    if (!$videoThumbnail)
    {
    $media['noThumb'] = true;
    }
    
    change to
    Code:
    if(preg_match('/\[media=(.*?)\](.*?)\[\/media\]/is', $media['media_tag'], $parts))
    {
    $media['mediaSite'] = "$parts[1].$parts[2]";
    $videoThumbnail = $this->getVideoThumbnailUrlFromParts($parts);
    $media['thumbnailUrl'] = $videoThumbnail;
    if (!$videoThumbnail)
    {
    $media['noThumb'] = true;
    }
    }
    
    



    is it media gallery problem? if so i come here to report




    .
    .
     
  2. Chris D

    Chris D XenForo Developer Staff Member

  3. 51463

    51463 Well-Known Member

    ok the link work,

    it say, the error happens when a media failed to embed, and every time someone view the media or in the media index, the error happen,

    so i delete the media, it was easy to find because it has no thumbnail


    now errors are gone,

    tank you sir


    .
    .
     

Share This Page