diff --git a/application/modules/bulletin/controllers/ViewController.php b/application/modules/bulletin/controllers/ViewController.php index f620281f1604139858d7226fdf242f13bb24f85b..a01ef797c19990bd3bc72e21288e1beacd4f2b7e 100644 --- a/application/modules/bulletin/controllers/ViewController.php +++ b/application/modules/bulletin/controllers/ViewController.php @@ -149,18 +149,20 @@ class Bulletin_ViewController extends Requests_ViewController $contents = $repo->getFileNotes( '/data/' . $repo->getFilePathForSection($section), $parentCommit ); - $contents = Bulletin_SectionModel::getBodyHtml($contents); - //$contents = UNL_UndergraduateBulletin_EPUB_Utilities::format($contents); - $contents = UNL_UndergraduateBulletin_EPUB_Utilities::convertHeadings($contents); - $requestOriginalFileContents[$request->getId()] = $contents; - $contents = $repo->getFileNotes( + $originalFileContents = $repo->getFileContents('/data/' . $repo->getFilePathForSection($section), $parentCommit); + $originalFileContents = Bulletin_SectionModel::getBodyHtml($originalFileContents); + //$originalFileContents = UNL_UndergraduateBulletin_EPUB_Utilities::format($originalFileContents); + $originalFileContents = UNL_UndergraduateBulletin_EPUB_Utilities::convertHeadings($originalFileContents); + $requestOriginalFileContents[$request->getId()] = $originalFileContents; + + $proposedFileContents = $repo->getFileNotes( '/data/' . $repo->getFilePathForSection($section), 'request-' . $request->getId() ); - $contents = Bulletin_SectionModel::getBodyHtml($contents); - //$contents = UNL_UndergraduateBulletin_EPUB_Utilities::format($contents); - $contents = UNL_UndergraduateBulletin_EPUB_Utilities::convertHeadings($contents); - $requestProposedFileContents[$request->getId()] = $contents; + $proposedFileContents = Bulletin_SectionModel::getBodyHtml($proposedFileContents); + //$proposedFileContents = UNL_UndergraduateBulletin_EPUB_Utilities::format($proposedFileContents); + $proposedFileContents = UNL_UndergraduateBulletin_EPUB_Utilities::convertHeadings($proposedFileContents); + $requestProposedFileContents[$request->getId()] = $proposedFileContents; } $this->view->requests = $requests; diff --git a/application/modules/bulletin/models/RepositoryModel.php b/application/modules/bulletin/models/RepositoryModel.php index 2cad2ec60275c3322cbb92675c64b5f2cf7b135f..f0d79cee6677f370723811b7e55dcc5b74110a7c 100644 --- a/application/modules/bulletin/models/RepositoryModel.php +++ b/application/modules/bulletin/models/RepositoryModel.php @@ -64,10 +64,13 @@ class Bulletin_RepositoryModel public function getFileNotes($path, $branch = 'master') { $object = $note = ''; + $filepath = $this->_repoPath . '/' . $path; $this->_checkout($branch); - $this->_git_exec('hash-object ' . escapeshellarg($this->_repoPath . '/' . $path), $object); - $this->_git_exec('notes --ref=creq show ' . escapeshellarg($object), $note); + if(file_exists($filepath)){ + $this->_git_exec('hash-object ' . escapeshellarg($filepath), $object); + $this->_git_exec('notes --ref=creq show ' . escapeshellarg($object), $note); + } $this->_checkout('master'); return $note;