I am able to cause an error trying to delete a wiki page for the built-in
wiki if I turn versioning on.
This example causes an error in web2py 2.9.5:
Starting with a new application, name it "wiki_test" and do the following:
# in db.py, add
auth.wiki(resolve=False)
auth.enable_record_versioning(db)
# in default.py replace index with
def index(): return auth.wiki()
# in default.py comment our authorization for table access (this simplified
testing)
#@auth.requires_signature()
Once completed use the app to...
1) Create a new user & login
2) Create a new wiki page which includes a tag
3) Delete the wiki_page using the url for the table deletion function
- for example
http://127.0.0.1:8000/wiki_test/default/data/delete/wiki_page/1
You should get a ticket for the following error:
<type 'exceptions.AttributeError'> 'NoneType' object has no attribute
'id'
with the following traceback:
> Traceback (most recent call last):
> File "/home/mdipierro/make_web2py/web2py/gluon/restricted.py", line 220, in
> restricted
> File
> *"C:/__PA/other/web2py/applications/wiki_test/controllers/default.py"*
> <http://127.0.0.1:8000/admin/default/edit/wiki_test/controllers/default.py>,
> line 80, in <module>
> File "/home/mdipierro/make_web2py/web2py/gluon/globals.py", line 385, in <
> lambda>
> File
> *"C:/__PA/other/web2py/applications/wiki_test/controllers/default.py"*
> <http://127.0.0.1:8000/admin/default/edit/wiki_test/controllers/default.py>,
> line 78, 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: 'NoneType' object has no attribute 'id'
If I repeat this, but comment out "auth.enable_record_versioning(db)" in
db.py, the error if eliminated. However, I'd like to use version tracking
with the wiki, so this is not a solution.
Is there a way to use versioning and delete wiki records without causing an
error?
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.