Modify

Opened 3 years ago

Closed 3 years ago

#9150 closed defect (fixed)

AttributeError happens with deleting a wiki page or a version of wiki page

Reported by: jun66j5 Owned by: saigon
Priority: normal Component: WikiCreateTicketPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.12

Description

Traceback (most recent call last):
  File "build\bdist.win32\egg\trac\web\main.py", line 511, in _dispatch_request
    dispatcher.dispatch(req)
  File "build\bdist.win32\egg\trac\web\main.py", line 237, in dispatch
    resp = chosen_handler.process_request(req)
  File "build\bdist.win32\egg\trac\wiki\web_ui.py", line 148, in process_request
    self._do_delete(req, versioned_page)
  File "build\bdist.win32\egg\trac\wiki\web_ui.py", line 255, in _do_delete
    @self.env.with_transaction()
  File "build\bdist.win32\egg\trac\db\api.py", line 77, in transaction_wrapper
    fn(ldb)
  File "build\bdist.win32\egg\trac\wiki\web_ui.py", line 263, in do_delete
    page.delete(version, db)
  File "build\bdist.win32\egg\trac\wiki\model.py", line 114, in delete
    listener.wiki_page_deleted(self)
AttributeError: 'WikiCreateTicket' object has no attribute 'wiki_page_deleted'

I think WikiCreateTicket module should have the following methods.

  • wikicreateticket/__init__.py

     
    2020    def wiki_page_changed(self, page, version, t, comment, author, ipnr): 
    2121        self.__parse_wiki_and_create_ticket(page, version) 
    2222 
     23    def wiki_page_deleted(self, page): 
     24        pass 
     25 
     26    def wiki_page_version_deleted(self, page): 
     27        pass 
     28 
     29    def wiki_page_renamed(self, page, old_name):  
     30        pass 
     31 
    2332    def __parse_wiki_and_create_ticket(self, page, version): 
    2433        page = WikiPage(self.env, page.name, version) 
    2534 

Attachments (0)

Change History (1)

comment:1 Changed 3 years ago by jun66j5

  • Resolution set to fixed
  • Status changed from new to closed

(In [10641]) Adds wiki_page_deleted, wiki_page_version_deleted and wiki_page_renamed. AttributeError happens when deleting a wiki page without these methods (fixed #9150).

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.