[MKDoc-users] [BUG] 1.8 ./.admin.userlist 500 error

Chris Croome chris at webarchitects.co.uk
Fri Sep 24 11:29:37 BST 2004


Hi

When someone is either not logged on or are logged on without admin
permissions they should receive a 404 error when accessing the user list
at this URI:

  ./.admin.userlist

However there is a 500 error:

  Can't call method "id" on an undefined value at /usr/local/mkdoc-1-8/flo/plugin/Admin/UserList.pm line 12.

This is line 12 of UserList.pm:

  $self->user()->id() == 1    || return;

I have looked at the template for this page, 
/resources/templates/admin/user_list/en.html and it hasn't been touched
for a long time, the i18n namespace hasn't been added and it hasn't yet
been updated to use macros rather than the old style includes. So I
suspect that the problem might not lie with the template.

When you are logged on as an admin user then there is a different error:

  http://lists.webarch.co.uk/pipermail/mkdoc-users/2004q3/000109.html

This is caused because in the template for the <head> of admin/editor pages,
/resources/fragments/head_admin/en.html there is this JavaScript which is
_only_ needed when editing page contents (it is for the WYSIWYG editor):

  <script type="text/javascript" src="/.resources/xeditor.js"></script>
  <script type="text/javascript" petal:condition="true: self; true: self/components --html">
    // call this at body.onload:
    function init() {
      use_lang ('${self/language');
      <?for name="element self/components --html"?>
      make_wysiwyg ('${element/block_name}');
      <?end?>
    }
  </script>

So a fix for this part of the bug is to move this code into the template for
editing the page contents (I think!) -- I'll try this now.  However there is
still a bug for non-admin users. 

Chris

-- 
Chris Croome                               <chris at webarchitects.co.uk>
web design                             http://www.webarchitects.co.uk/ 
web content management                               http://mkdoc.com/   


More information about the MKDoc-users mailing list