Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Curriculum-Request
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Tim Steiner
Curriculum-Request
Commits
4d986aa8
Commit
4d986aa8
authored
9 years ago
by
Roger W Feese
Browse files
Options
Downloads
Patches
Plain Diff
Add additional checks for existence of files when loading notes.
parent
4f3857ce
No related branches found
No related tags found
1 merge request
!30
Projects task 87
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
application/modules/bulletin/controllers/ViewController.php
+18
-14
18 additions, 14 deletions
application/modules/bulletin/controllers/ViewController.php
application/modules/bulletin/models/RepositoryModel.php
+2
-1
2 additions, 1 deletion
application/modules/bulletin/models/RepositoryModel.php
with
20 additions
and
15 deletions
application/modules/bulletin/controllers/ViewController.php
+
18
−
14
View file @
4d986aa8
...
...
@@ -146,22 +146,26 @@ class Bulletin_ViewController extends Requests_ViewController
$parentCommit
=
$repo
->
getParentCommitForSection
(
$section
);
$contents
=
$repo
->
getFileNotes
(
'/data/'
.
$repo
->
getFilePathForSection
(
$section
),
$parentCommit
);
$originalFileContents
=
$repo
->
getFileContents
(
'/data/'
.
$repo
->
getFilePathForSection
(
$section
),
$parentCommit
);
// Original file content
$originalFileContents
=
""
;
$originalFilePath
=
$repo
->
getFilePathForSection
(
$section
);
// Only attempt to get notes if getFilePathForSection actually returns a value
if
(
!
empty
(
$originalFilePath
)){
$originalFileContents
=
$repo
->
getFileContents
(
'/data/'
.
$originalFilePath
,
$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
()
);
// Proposed file content
$proposedFileContents
=
""
;
$proposedFilePath
=
$repo
->
getFilePathForSection
(
$section
);
// Only attempt to get notes if getFilePathForSection actually returns a value
if
(
!
empty
(
$proposedFilePath
)){
$proposedFileContents
=
$repo
->
getFileNotes
(
'/data/'
.
$proposedFilePath
,
'request-'
.
$request
->
getId
());
$proposedFileContents
=
Bulletin_SectionModel
::
getBodyHtml
(
$proposedFileContents
);
//$proposedFileContents = UNL_UndergraduateBulletin_EPUB_Utilities::format($proposedFileContents);
$proposedFileContents
=
UNL_UndergraduateBulletin_EPUB_Utilities
::
convertHeadings
(
$proposedFileContents
);
}
$requestProposedFileContents
[
$request
->
getId
()]
=
$proposedFileContents
;
}
...
...
This diff is collapsed.
Click to expand it.
application/modules/bulletin/models/RepositoryModel.php
+
2
−
1
View file @
4d986aa8
...
...
@@ -67,7 +67,8 @@ class Bulletin_RepositoryModel
$filepath
=
$this
->
_repoPath
.
'/'
.
$path
;
$this
->
_checkout
(
$branch
);
if
(
file_exists
(
$filepath
)){
//make sure path exists and it is a file
if
(
file_exists
(
$filepath
)
&&
is_file
(
$filepath
)){
$this
->
_git_exec
(
'hash-object '
.
escapeshellarg
(
$filepath
),
$object
);
$this
->
_git_exec
(
'notes --ref=creq show '
.
escapeshellarg
(
$object
),
$note
);
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment