Uploaded image for project: 'JSPWiki'
  1. JSPWiki
  2. JSPWIKI-936

error when remove page with link

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.10.2
    • None
    • Core & storage
    • None
    • Windows 8.1, Java 8u45

    Description

      1. Login
      2. Create new page
      3. Then click Attach, select file and click Upload
      4. Edit the page and specify link to attached file name on page content - [attached_file_name.png] in my case. Click Save
        Click Info and click "Delete Entire Page", click "Confirm" at confirmation popup
        => get error

      To make a temporary fix I updated "WikiEngine.deletePage" method with the following code:

          public void deletePage( String pageName )
              throws ProviderException
          {
              WikiPage p = getPage( pageName );
      
              if( p != null )
              {
                  if( p instanceof Attachment )
                  {
                      m_attachmentManager.deleteAttachment( (Attachment) p );
                  }
                  else
                  {
                      Collection<String> refTo = m_referenceManager.findRefersTo(pageName);
      
                      if (m_attachmentManager.hasAttachments( p ))
                      {
                          Collection attachments = m_attachmentManager.listAttachments( p );
                          for( Iterator atti = attachments.iterator(); atti.hasNext(); )
                          {
                              Attachment attachment = (Attachment)atti.next();
                              refTo.remove(attachment.getName());
      
                              m_attachmentManager.deleteAttachment( attachment );
                          }
                      }
                      m_pageManager.deletePage( p );
                      firePageEvent( WikiPageEvent.PAGE_DELETED, pageName );
                  }
              }
          }
      

      Attachments

        Activity

          People

            metskem Harry Metske
            bioform Andrew Krasnoff
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: