The isset($item[0]['fid']) throws an error if $item[0] is not always an array. To be honest, the entire function looks dodgy...
function scorm_attributes_access($node) {
$arr = (array) $node;
foreach($arr as $item) {
if(isset($item[0])) {
if(iisset($item[0]['fid'])) {
if(file_is_scorm($item[0]['fid'])) {
return TRUE;
}
}
}
}
}
Notice:
[Fri Feb 18 15:07:44 2011] [error] [client 193.157.82.30] PHP Fatal error: Cannot use object of type stdClass as array in /var/www/sites/all/modules/contrib/cck_scorm/SCORM.module on line 3046, referer: http://www.ourdomain.com/admin/content/node
Comments
Comment #1
dirk.westrup commentedComment #2
pgerling commentedThis will be fixed in the next release.
Indeed, the whole function doesnt look that good. I still have to figure out a better way how to check if the node is using cck_scorm. I have some ideas on my mind and will discuss them with Dirk asap.
Comment #3
pgerling commentedFixed - tho the function still looks that "strange" - feel free to tell me a better way to check for this particular file field ;)
Thanks a lot for your bug report!
Comment #4
fuzzy76 commentedYou need to add another fix to the line below, like so:
Comment #5
pgerling commentedWe fixed this issue and will distribute it with the next release.
Thanks a lot for your help! :o)
Comment #6
pgerling commentedFixed in beta20.
Comment #7
pgerling commented