@@ -73,7 +73,7 @@ public function form(Resource $entry, $new = false)
7373 $ tagFactory = new TagFactory ();
7474
7575 $ sourceHttp = PHPWS_SOURCE_HTTP ;
76- $ status = $ new ? 'Draft ' : 'Last updated ' . $ entry ->relativeTime ($ entry ->updateDate );
76+ $ status = $ new || empty ( $ entry -> updateDate ) ? 'Draft ' : 'Last updated ' . $ entry ->relativeTime ($ entry ->updateDate );
7777 $ entryVars = $ entry ->getStringVars ();
7878 $ entryVars ['content ' ] = $ this ->prepareFormContent ($ entryVars ['content ' ]);
7979 $ tags = $ tagFactory ->listTags (true );
@@ -132,7 +132,6 @@ private function includeCards(Resource $entry)
132132 \Layout::addJSHeader ($ this ->includeTwitterCards ($ entry ));
133133 }
134134
135-
136135 /**
137136 * Medium editor insert doesn't initialize the Twitter embed. Has to be done
138137 * manually. The editor includes a script call to widgets BUT that is stripped
@@ -196,10 +195,10 @@ public function inListView($id)
196195
197196 \Layout::addJSHeader ($ this ->mediumCSSOverride ());
198197 $ entry = $ this ->factory ->load ($ id );
199- $ data = $ this ->factory ->data ($ entry , !$ this ->isAdmin );
200- if (empty ($ data )) {
201- throw new ResourceNotFound ($ id );
198+ if (!$ this ->isAdmin && (!$ entry ->published && $ entry ->publishDate < time ())) {
199+ return null ;
202200 }
201+ $ data = $ entry ->getStringVars (true );
203202 $ this ->includeCards ($ entry );
204203
205204 if ($ entry ->listView == 1 ) {
@@ -216,7 +215,7 @@ public function inListView($id)
216215 } else {
217216 $ data ['summaryAnchor ' ] = '' ;
218217 }
219-
218+
220219 $ templateFile = 'Entry/SummaryListView.html ' ;
221220 }
222221 // Removed the summary break tag
@@ -248,10 +247,10 @@ public function view($id)
248247 try {
249248 $ this ->includeCss ();
250249 $ entry = $ this ->factory ->load ($ id );
251- $ data = $ this ->factory ->data ($ entry , !$ this ->isAdmin );
252- if (empty ($ data )) {
253- throw new ResourceNotFound ;
250+ if (!$ this ->isAdmin && (!$ entry ->published && $ entry ->publishDate < time ())) {
251+ return null ;
254252 }
253+ $ data = $ entry ->getStringVars (true );
255254 $ this ->includeCards ($ entry );
256255 if (stristr ($ entry ->content , 'twitter ' )) {
257256 $ this ->loadTwitterScript (true );
0 commit comments