How to delete built in wiki page that has a tag and uses versioning?

16 views
Skip to first unread message

Ed Tate

unread,
Aug 28, 2014, 11:51:31 AM8/28/14
to web...@googlegroups.com
If I use the builtin wiki feature and turn on record versioning, I get error when I delete a wiki page which has a tag. Is there a way around this issue?

Recipe to duplicate the error in web2py 2.9.5:

1) Create a new application. Call it 'test_wiki'.
2) Make the following modifications:

add the following two lines to the end of db.py:
auth.wiki(resolve=False)
auth
.enable_record_versioning(db)



replace the index function in default.py with:
def index(): return auth.wiki()


To simplify testing, comment out @auth.requires_signature()  on the data function.

#@auth.requires_signature()
def data():
...

3) Open the application and register as a new user: http://127.0.0.1:8000/test_wiki/default/user/register
4) Create a new page: http://127.0.0.1:8000/test_wiki/default/index/_create/index , then hit create from slug
5) Add a tag
6) Hit submit
7) Delete the wiki page using http://127.0.0.1:8000/test_wiki/default/data/delete/wiki_page/1 . This fails. It results in an internal error and a ticket. The error is "<type 'exceptions.AttributeError'> 'NoneType' object has no attribute 'id'" with a traceback of:

1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
Traceback (most recent call last):
File "/home/mdipierro/make_web2py/web2py/gluon/restricted.py", line 220, in restricted
File "D:/_PA/web2py_win/web2py/applications/test_wiki/controllers/default.py", line 78, in <module>
File "/home/mdipierro/make_web2py/web2py/gluon/globals.py", line 385, in <lambda>
File "D:/_PA/web2py_win/web2py/applications/test_wiki/controllers/default.py", line 76, in data
return dict(form=crud())
File "/home/mdipierro/make_web2py/web2py/gluon/tools.py", line 3813, in __call__
File "/home/mdipierro/make_web2py/web2py/gluon/tools.py", line 4047, in delete
File "/home/mdipierro/make_web2py/web2py/gluon/dal.py", line 8982, in __delitem__
File "/home/mdipierro/make_web2py/web2py/gluon/dal.py", line 10534, in delete
File "/home/mdipierro/make_web2py/web2py/gluon/dal.py", line 10534, in <genexpr>
File "/home/mdipierro/make_web2py/web2py/gluon/dal.py", line 8822, in <lambda>
File "/home/mdipierro/make_web2py/web2py/gluon/dal.py", line 10550, in update
File "/home/mdipierro/make_web2py/web2py/gluon/tools.py", line 5440, in update_tags_update
AttributeError






Reply all
Reply to author
Forward
0 new messages