OSDN Git Service

Model::Stories: not to set 'neverdisplay' parameter if not parameter given
authorhylom <hylom@users.osdn.me>
Wed, 12 Jun 2019 14:49:00 +0000 (14:49 +0000)
committerhylom <hylom@users.osdn.me>
Wed, 12 Jun 2019 14:49:00 +0000 (14:49 +0000)
src/newslash_web/lib/Newslash/Model/Stories.pm
src/newslash_web/lib/Newslash/Web/Controller/API/Story.pm

index cdff234..8804457 100644 (file)
@@ -599,7 +599,8 @@ sub create {
         $self->set_error($msg, -1);
         return;
     }
-    $params->{neverdisplay} ||= 0;
+    # if neverdisplay is set, the story not included in RSS...
+    #$params->{neverdisplay} ||= 0;
     $params->{uid} = $user->{uid};
 
     # check submission
index 87a63c1..7f68440 100644 (file)
@@ -193,7 +193,9 @@ sub post {
     }
 
     $params->{commentstatus} = $item->{commentstatus} || $item->{comment_status} || "enabled";
-    $params->{neverdisplay} = $item->{display} ? 0 : 1;
+    if (!$item->{display}) {
+       $params->{neverdisplay} = 1;
+    }
 
     $params->{action} = $data->{action} || 'preview';