JSPWiki
  1. JSPWiki
  2. JSPWIKI-775

saving a page without supplying a change note will render a "null" change note in PageInfo.jsp

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.9.1
    • Fix Version/s: 2.9.1
    • Component/s: Core & storage
    • Labels:
      None
    • Environment:

      Ubuntu 12.04
      OpenJDK 7
      Tomcat 7.0.37

      Description

      Create a new page, or update an existing page, and do not provide a change note while saving it.
      Go to the Info Tab to see the revisions, and you will see a change note "null".

      I would expect the change note to be empty.

        Activity

        Hide
        Juan Pablo Santos Rodríguez added a comment -

        proposed change:

        Edit.jsp, lines 161-168
                if( changenote != null && changenote.length() > 0 )
                {
                    modifiedPage.setAttribute( WikiPage.CHANGENOTE, changenote );
                }
                else
                {
                    modifiedPage.removeAttribute( WikiPage.CHANGENOTE );
                }
        

        with:

        Edit.jsp, lines 161-168
                if( changenote != null && changenote.length() > 0 )
                {
                    modifiedPage.setAttribute( WikiPage.CHANGENOTE, changenote );
                }
                else
                {
                    modifiedPage.setAttribute( WikiPage.CHANGENOTE, "" );
                }
        

        thoughts?

        Show
        Juan Pablo Santos Rodríguez added a comment - proposed change: Edit.jsp, lines 161-168 if ( changenote != null && changenote.length() > 0 ) { modifiedPage.setAttribute( WikiPage.CHANGENOTE, changenote ); } else { modifiedPage.removeAttribute( WikiPage.CHANGENOTE ); } with: Edit.jsp, lines 161-168 if ( changenote != null && changenote.length() > 0 ) { modifiedPage.setAttribute( WikiPage.CHANGENOTE, changenote ); } else { modifiedPage.setAttribute( WikiPage.CHANGENOTE, "" ); } thoughts?
        Hide
        Harry Metske added a comment -

        works fine.

        +1

        Show
        Harry Metske added a comment - works fine. +1
        Hide
        brushed added a comment -

        The proposed solution adds changenote attributes, even if no changenotes were entered. I believe it is better to avoid this.

        An alternative way to solve the issue is to modify InfoContent.jsp

        Modify around line 224:

                 <td class="changenote">
                   <% String changenote = (String) currentPage.getAttribute( WikiPage.CHANGENOTE );  %>
        		   <%= (changenote==null) ? "" : changenote  %>
                 </td>
        

        Modify around line 376:

              <td class='changenote'>
                <% String changenote = (String) att.getAttribute( WikiPage.CHANGENOTE ); %>
        		<%= (changenote==null) ? "" : changenote  %>
              </td>
        

        dirk

        Show
        brushed added a comment - The proposed solution adds changenote attributes, even if no changenotes were entered. I believe it is better to avoid this. An alternative way to solve the issue is to modify InfoContent.jsp Modify around line 224: <td class= "changenote" > <% String changenote = ( String ) currentPage.getAttribute( WikiPage.CHANGENOTE ); %> <%= (changenote== null ) ? "" : changenote %> </td> Modify around line 376: <td class='changenote'> <% String changenote = ( String ) att.getAttribute( WikiPage.CHANGENOTE ); %> <%= (changenote== null ) ? "" : changenote %> </td> dirk
        Hide
        Juan Pablo Santos Rodríguez added a comment -

        yep, my proposed solution was about forgetting about not having a changenote, but I agree, better if that's avoidable.

        Dirk, could you commit the changes you describe? (won't have svn access 'til a few hours)

        thx,
        juan pablo

        Show
        Juan Pablo Santos Rodríguez added a comment - yep, my proposed solution was about forgetting about not having a changenote, but I agree, better if that's avoidable. Dirk, could you commit the changes you describe? (won't have svn access 'til a few hours) thx, juan pablo
        Hide
        brushed added a comment -

        Resolved in 2.9.1-incubating-2

        Show
        brushed added a comment - Resolved in 2.9.1-incubating-2

          People

          • Assignee:
            Unassigned
            Reporter:
            Harry Metske
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development