New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tag_posts: Contains draft posts as well as published posts #213

Closed
uli-heller opened this Issue Jun 7, 2015 · 1 comment

Comments

Projects
None yet
2 participants
@uli-heller
Contributor

uli-heller commented Jun 7, 2015

I believe there is an error within "tag_posts". From what I understand, only published posts are supposed ton show up within the list. Unfortunately, draft posts seem to show up, too. This leads to broken links.

For me, a simple change to ContentStore.java seems to fix the issue.

The version I used is 2.4.0.

diff --git a/src/main/java/org/jbake/app/ContentStore.java b/src/main/java/org/jbake/app/ContentStore.java
index d7074d7..f7bd679 100644
--- a/src/main/java/org/jbake/app/ContentStore.java
+++ b/src/main/java/org/jbake/app/ContentStore.java
@@ -94,7 +94,7 @@ public class ContentStore {
     }

     public List<ODocument> getPublishedPostsByTag(String tag) {
-        return query("select * from post where status='published' where ? in tags order by date desc", tag);
+        return query("select * from post where status='published' and ? in tags order by date desc", tag);
     }

     public List<ODocument> getPublishedPages() {

I'll create a pull request for this... #214
Maybe it was a bad idea to create an issue AND a pull request, the pull request is probably sufficient...

uli-heller added a commit to uli-heller/jbake that referenced this issue Jun 7, 2015

uli-heller added a commit to uli-heller/jbake that referenced this issue Jun 7, 2015

@jonbullock jonbullock added this to the v2.5.0 milestone Jun 8, 2015

@jonbullock jonbullock self-assigned this Jun 8, 2015

@jonbullock

This comment has been minimized.

Show comment
Hide comment
@jonbullock

jonbullock Jun 8, 2015

Member

Thanks for taking the time to raise this issue.

Member

jonbullock commented Jun 8, 2015

Thanks for taking the time to raise this issue.

jonbullock added a commit that referenced this issue Jun 22, 2016

Merge pull request #214 from uli-heller/patch-2
Fix for issue #213 - tag_posts: Contains draft posts as well as publi…
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment