5 Replies Latest reply on May 18, 2004 7:57 AM by julien1

    View newest Post Bug

    lcb

      The "View newest Post" Button shows the newest Post in the forum, not in the topic.
      I think i have found the solution for this problem:

      Index: PostEJB.java
      ===================================================================
      RCS file: /cvsroot/jboss/nukes/bb/src/main/org/jboss/nukes/addons/modules/bb/ejb/PostEJB.java,v
      retrieving revision 1.10
      diff -u -r1.10 PostEJB.java
      --- PostEJB.java 25 Jan 2004 20:33:05 -0000 1.10
      +++ PostEJB.java 17 May 2004 10:53:29 -0000
      @@ -62,6 +62,10 @@
       * @ejb.finder
       * signature="org.jboss.nukes.addons.modules.bb.ejb.PostEJBLocal findLatestPost(java.util.Date threshold)"
       * query="SELECT OBJECT(p) FROM post AS p"
      + *
      + * @ejb.finder
      + * signature="org.jboss.nukes.addons.modules.bb.ejb.PostEJBLocal findLatestPost(java.util.Date threshold, org.jboss.nukes.addons.modules.bb.ejb.TopicEJBLocal topic)"
      + * query="SELECT OBJECT(p) FROM post AS p"
       *
       * @ejb.finder
       * signature="java.util.Collection findRange(int offset, int limit)"
      @@ -102,6 +106,10 @@
       * @jboss.query
       * signature="org.jboss.nukes.addons.modules.bb.ejb.PostEJBLocal findLatestPost(java.util.Date threshold)"
       * query="SELECT OBJECT(p) FROM post AS p WHERE p.postDate>=?1 ORDER BY p.postDate LIMIT 1"
      + *
      + * @jboss.query
      + * signature="org.jboss.nukes.addons.modules.bb.ejb.PostEJBLocal findLatestPost(java.util.Date threshold, org.jboss.nukes.addons.modules.bb.ejb.TopicEJBLocal topic)"
      + * query="SELECT OBJECT(p) FROM post AS p WHERE p.postDate>=?1 AND p.topic=?2 ORDER BY p.postDate LIMIT 1"
       *
       * @jboss.query
       * signature="java.util.Collection findRange(int offset, int limit)"
      


      Index: BBModule.java
      ===================================================================
      RCS file: /cvsroot/jboss/nukes/bb/src/main/org/jboss/nukes/addons/modules/bb/BBModule.java,v
      retrieving revision 1.64
      diff -u -r1.64 BBModule.java
      --- BBModule.java 15 May 2004 23:40:17 -0000 1.64
      +++ BBModule.java 17 May 2004 10:52:17 -0000
      @@ -2195,7 +2195,8 @@
       Date lastVisit = user.getPreviousLastVisitDate();
       try
       {
      - PostEJBLocal post = homesRO.post.findLatestPost(lastVisit);
      + topic=homesRO.topic.findByPrimaryKey(topicId);
      + PostEJBLocal post = homesRO.post.findLatestPost(lastVisit, topic);
       page.sendRedirect("index.html?module=bb&op=viewtopic&p=" + post.getId() + "#" + post.getId());
       return;
       }
      





        • 1. Re: View newest Post Bug

          I would like to know how to trigger that view :-) to test it by myself.

          • 2. Re: View newest Post Bug
            lcb

            Hmm, i will try to explain.
            You must go to a forum which has new Posts for you.
            For each topic in this Forum which has new Posts for you, you will find an icon left beside the topic headline. A click on this should bring you to the newest post of this topic, but it doesn`t.





            • 3. Re: View newest Post Bug

              that makes sense, I have just commited the patch in the CVS

              • 4. Re: View newest Post Bug
                lcb

                After making a complete new install i can`t replyto a post anymore.
                I tougth this has something to do with the changes i made. After searching the code i found
                an bug in the Context.class

                Index: Context.java
                ===================================================================
                RCS file: /cvsroot/jboss/nukes/bb/src/main/org/jboss/nukes/addons/modules/bb/Context.java,v
                retrieving revision 1.8
                diff -u -r1.8 Context.java
                --- Context.java 15 May 2004 23:40:26 -0000 1.8
                +++ Context.java 17 May 2004 15:05:09 -0000
                @@ -147,7 +147,7 @@
                 {
                 ReplyCommand rc = new ReplyCommand();
                 rc.quote = false;
                - rc.postId = p_topic_id;
                + rc.postId = p_post_id;
                 rc.message = p_message;
                 rc.current_time = new Date();
                 rc.mode = c_refresh ? ReplyCommand.MODE_REFRESH : (p_submit ? ReplyCommand.MODE_COMMIT : ReplyCommand.MODE_INITIALIZE);
                


                After doing this all works fine for me. But please test it.

                • 5. Re: View newest Post Bug

                  I will check that when I'll have some time (i.e later this week)