• Remember Mailing List

  • disabled fields in personalize_form for zope root admin

    from jhb on May 22, 2010 08:14 AM
    Hi *,
    
    I basically have the same behaviour as in
    
    https://www.coactivate.org/projects/remember/lists/remember/archive/2007/12/1197298124524
    
    which is that my admin user from the zope root can't change settings in
    personilze form. This happens as soon as remember is installed on a
    fresh site. I have read Robs answers to the email above, but don't see
    how to make use of his pointers.
    
    I am using a buildout which extends
    
    http://dist.plone.org/release/3.3.5/versions.cfg
    
    Any ideas or pointers?
    
    Cheers,
    
      Joerg
    
    Thread Outline:
  • Re: disabled fields in personalize_form for zope root admin

    from jhb on May 22, 2010 09:55 AM
    > https://www.coactivate.org/projects/remember/lists/remember/archive/2007/12/1197298124524
    
    I poked a bit more around the issue:
    http://baach.de/Members/jhb/research-notes/plone-can-edit-admin-user-in-personalize_form-if-remember-is-installed
    
    Turns out that PAS checks:
    
    mdata = getToolByName(self, 'portal_memberdata', None)
        if mdata:
    
    Due to remembers MemberDataContainer being a BTree, and having a __len__
    method, but the tree being empty, this evaluates to false.
    
    Now, I can fix it by giving the MemberDataContainer a __nonzero__ (and
    file a bug+patch to remember), or change the PAS so that it does 'if
    mdata != None' (and file a bug with PAS).
    
    Which way to go?
    
    Cheers,
    
      Joerg
    
    
    • Re: disabled fields in personalize_form for zope root admin

      from ra on May 22, 2010 06:14 PM
      On 05/22/2010 02:54 AM, Joerg Baach wrote:
      >> https://www.coactivate.org/projects/remember/lists/remember/archive/2007/12/1197298124524
      >
      > I poked a bit more around the issue:
      > http://baach.de/Members/jhb/research-notes/plone-can-edit-admin-user-in-personalize_form-if-remember-is-installed
      >
      > Turns out that PAS checks:
      >
      > mdata = getToolByName(self, 'portal_memberdata', None)
      >      if mdata:
      >
      > Due to remembers MemberDataContainer being a BTree, and having a __len__
      > method, but the tree being empty, this evaluates to false.
      >
      > Now, I can fix it by giving the MemberDataContainer a __nonzero__ (and
      > file a bug+patch to remember), or change the PAS so that it does 'if
      > mdata != None' (and file a bug with PAS).
      >
      > Which way to go?
      
      Personally, I consider this a PAS bug.  I think it's A Bad Idea® to do an "if 
      foo:" check when what you really mean is "if foo is None:", since with duck 
      typing you never know what circumstances might cause an object to evaluate to 
      False, as you've discovered here.
      
      -r