Client Deleted Fileset Resulted in Call of Function on Non-Object
Permalink Browser Info Environment
Hey guys. Thank you for putting this block out for everyone... it has come in handy many times.
I wanted to suggest a minor fix for future versions. I passed a completed site on to a client and almost immediately got a call that they had broken the site. Turns out they deleted the fileset that was already in place on one of the pages already created (and in fact it was set up on the page-type output making that inaccessible as well). In tinkering I added a check to see if $fs was an object and it solved all issues. The change though is in the controller and I fear that if the package is ever updated, my change will go bye bye.
Anyway. Just a suggestion.
Cheers,
C
I wanted to suggest a minor fix for future versions. I passed a completed site on to a client and almost immediately got a call that they had broken the site. Turns out they deleted the fileset that was already in place on one of the pages already created (and in fact it was set up on the page-type output making that inaccessible as well). In tinkering I added a check to see if $fs was an object and it solved all issues. The change though is in the controller and I fear that if the package is ever updated, my change will go bye bye.
Anyway. Just a suggestion.
Cheers,
C
function view(){ $fsID = $this->fileset; $bID = $this->bID; $db = Loader::db(); $existingThumbs = $db->GetAll('SELECT * from btVividThumbGalleryThumb WHERE bID = ? ORDER BY sort', array($bID)); //gives us all the files we've already saved/sorted $existingThumbIDs = array(); foreach($existingThumbs as $thumb){ $existingThumbIDs[] = $thumb['fID']; } $fs = FileSet::getByID($fsID); if (is_object($fs)) { $fileList = new FileList(); $fileList->filterBySet($fs); $fileList->filterByType(FileType::T_IMAGE); $fileList->sortByFileSetDisplayOrder();
Viewing 15 lines of 31 lines. View entire code block.
Type: | Discussion |
---|---|
Status: | New |