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

Duplicate Media Gallery Error

Affected version
XF2 Beta

DaveM

Well-known member
#1
I have setup a test forum on my server and uploaded two images to a user created gallery. On the upload I got the following errors but it did upload the two images by the looks of it.

Code:
ErrorException: array_keys() expects parameter 1 to be array, null given in src/addons/XFMG/Notifier/Media/CategoryWatch.php at line 70

  
[LIST]
[*]ErrorException: Trying to get property of non-object
[*]src/addons/XFMG/Notifier/Media/CategoryWatch.php:70
[*]Generated by: DaveM
[*]Sep 8, 2017 at 10:24 AM
[/LIST]
 Stack trace
#0 /home/davem/public_html/xf2/src/addons/XFMG/Notifier/Media/CategoryWatch.php(70): XF::handlePhpError(8, 'Trying to get p...', '/home/davem/pub...', 70, Array) #1 /home/davem/public_html/xf2/src/XF/Service/AbstractNotifier.php(258): XFMG\Notifier\Media\CategoryWatch->getDefaultNotifyData() #2 /home/davem/public_html/xf2/src/XF/Service/AbstractNotifier.php(31): XF\Service\AbstractNotifier->ensureDataLoaded() #3 /home/davem/public_html/xf2/src/XF/Service/AbstractNotifier.php(56): XF\Service\AbstractNotifier->notify(3) #4 /home/davem/public_html/xf2/src/addons/XFMG/Service/Media/Creator.php(282): XF\Service\AbstractNotifier->notifyAndEnqueue(3) #5 /home/davem/public_html/xf2/src/addons/XFMG/Pub/Controller/Media.php(664): XFMG\Service\Media\Creator->sendNotifications() #6 /home/davem/public_html/xf2/src/addons/XFMG/Pub/Controller/Media.php(741): XFMG\Pub\Controller\Media->finalizeMediaItemCreate(Object(XFMG\Service\Media\Creator)) #7 /home/davem/public_html/xf2/src/XF/Mvc/Dispatcher.php(232): XFMG\Pub\Controller\Media->actionSaveMedia(Object(XF\Mvc\ParameterBag)) #8 /home/davem/public_html/xf2/src/XF/Mvc/Dispatcher.php(85): XF\Mvc\Dispatcher->dispatchClass('XFMG:Media', 'save-media', 'json', Object(XF\Mvc\ParameterBag), 'xfmg') #9 /home/davem/public_html/xf2/src/XF/Mvc/Dispatcher.php(41): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch)) #10 /home/davem/public_html/xf2/src/XF/App.php(1771): XF\Mvc\Dispatcher->run() #11 /home/davem/public_html/xf2/src/XF.php(319): XF\App->run() #12 /home/davem/public_html/xf2/index.php(13): XF::runApp('XF\\Pub\\App') #13 {main} Request state
array(3) {  ["url"] => string(17) "/media/save-media"  ["_GET"] => array(0) {  }  ["_POST"] => array(9) {    ["attachment_hash"] => string(32) "6d1f538caad135e3e762a71b347e8958"    ["attachment_hash_combined"] => string(76) "{"type":"xfmg_media","context":[],"hash":"6d1f538caad135e3e762a71b347e8958"}"    ["media"] => array(2) {      [1] => array(6) {        ["title"] => string(9) "Cool Bike"        ["description"] => string(15) "Cool bike photo"        ["temp_media_id"] => string(1) "1"        ["media_hash"] => string(32) "46d1df016058ee550e672bdb966dddae"        ["media_type"] => string(5) "image"        ["attachment_id"] => string(1) "6"      }      [3] => array(6) {        ["title"] => string(6) "Riding"        ["description"] => string(16) "Going for a ride"        ["temp_media_id"] => string(1) "3"        ["media_hash"] => string(32) "13cd28deab124eaac71d11f2da51e789"        ["media_type"] => string(5) "image"        ["attachment_id"] => string(1) "8"      }    }    ["album"] => array(2) {      ["title"] => string(11) "Motorcycles"      ["description"] => string(21) "My Motorcycle Photos "    }    ["album_id"] => string(1) "0"    ["_xfToken"] => string(8) "********"    ["_xfRequestUri"] => string(20) "/media/albums/create"    ["_xfWithData"] => string(1) "1"    ["_xfResponseType"] => string(4) "json"  } }
and

Code:
    ErrorException: array_keys() expects parameter 1 to be array, null given src/addons/XFMG/Notifier/Media/CategoryWatch.php:70

    Generated by: DaveM Sep 8, 2017 at 10:24 AM

Stack trace

#0 [internal function]: XF::handlePhpError(2, 'array_keys() ex...', '/home/davem/pub...', 70, Array)
#1 /home/davem/public_html/xf2/src/addons/XFMG/Notifier/Media/CategoryWatch.php(70): array_keys(NULL)
#2 /home/davem/public_html/xf2/src/XF/Service/AbstractNotifier.php(258): XFMG\Notifier\Media\CategoryWatch->getDefaultNotifyData()
#3 /home/davem/public_html/xf2/src/XF/Service/AbstractNotifier.php(31): XF\Service\AbstractNotifier->ensureDataLoaded()
#4 /home/davem/public_html/xf2/src/XF/Service/AbstractNotifier.php(56): XF\Service\AbstractNotifier->notify(3)
#5 /home/davem/public_html/xf2/src/addons/XFMG/Service/Media/Creator.php(282): XF\Service\AbstractNotifier->notifyAndEnqueue(3)
#6 /home/davem/public_html/xf2/src/addons/XFMG/Pub/Controller/Media.php(664): XFMG\Service\Media\Creator->sendNotifications()
#7 /home/davem/public_html/xf2/src/addons/XFMG/Pub/Controller/Media.php(741): XFMG\Pub\Controller\Media->finalizeMediaItemCreate(Object(XFMG\Service\Media\Creator))
#8 /home/davem/public_html/xf2/src/XF/Mvc/Dispatcher.php(232): XFMG\Pub\Controller\Media->actionSaveMedia(Object(XF\Mvc\ParameterBag))
#9 /home/davem/public_html/xf2/src/XF/Mvc/Dispatcher.php(85): XF\Mvc\Dispatcher->dispatchClass('XFMG:Media', 'save-media', 'json', Object(XF\Mvc\ParameterBag), 'xfmg')
#10 /home/davem/public_html/xf2/src/XF/Mvc/Dispatcher.php(41): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#11 /home/davem/public_html/xf2/src/XF/App.php(1771): XF\Mvc\Dispatcher->run()
#12 /home/davem/public_html/xf2/src/XF.php(319): XF\App->run()
#13 /home/davem/public_html/xf2/index.php(13): XF::runApp('XF\\Pub\\App')
#14 {main}

Request state

array(3) {
  ["url"] => string(17) "/media/save-media"
  ["_GET"] => array(0) {
  }
  ["_POST"] => array(9) {
    ["attachment_hash"] => string(32) "6d1f538caad135e3e762a71b347e8958"
    ["attachment_hash_combined"] => string(76) "{"type":"xfmg_media","context":[],"hash":"6d1f538caad135e3e762a71b347e8958"}"
    ["media"] => array(2) {
      [1] => array(6) {
        ["title"] => string(9) "Cool Bike"
        ["description"] => string(15) "Cool bike photo"
        ["temp_media_id"] => string(1) "1"
        ["media_hash"] => string(32) "46d1df016058ee550e672bdb966dddae"
        ["media_type"] => string(5) "image"
        ["attachment_id"] => string(1) "6"
      }
      [3] => array(6) {
        ["title"] => string(6) "Riding"
        ["description"] => string(16) "Going for a ride"
        ["temp_media_id"] => string(1) "3"
        ["media_hash"] => string(32) "13cd28deab124eaac71d11f2da51e789"
        ["media_type"] => string(5) "image"
        ["attachment_id"] => string(1) "8"
      }
    }
    ["album"] => array(2) {
      ["title"] => string(11) "Motorcycles"
      ["description"] => string(21) "My Motorcycle Photos "
    }
    ["album_id"] => string(1) "0"
    ["_xfToken"] => string(8) "********"
    ["_xfRequestUri"] => string(20) "/media/albums/create"
    ["_xfWithData"] => string(1) "1"
    ["_xfResponseType"] => string(4) "json"
  }
}