*/
protected static function _getCollectionAndTheme($id, $hash, &$collection, &$theme)
{
- $collection = FluidbookCollection::find($id)->where('hash', $hash)->first();
+ $collection = FluidbookCollection::withoutGlobalScopes()->where('id', $id)->where('hash', $hash)->first();
if (null === $collection) {
abort(404);
}
foreach ($collection->publications as $pub) {
- $firstFluidbookId = $pub['fluidbook'];
+ $fluidbook = FluidbookPublication::withoutGlobalScopes()->find( $pub['fluidbook']);
+ if (null === $fluidbook) {
+ continue;
+ }
break;
}
- $fluidbook = FluidbookPublication::find($firstFluidbookId);
if (!isset($theme)) {
$theme = $fluidbook->getTheme();
}