isset - determines whether a variable is set

empty - determines whether a variable is empty

empty also works on array()

An empty $items passed to theme_item_list produces the following string '

    '. HTML validators choke on such empty lists.

    Replacing isset with !empty solves this problem.

    Paddy.

    Support from Acquia helps fund testing for Drupal Acquia logo

    Comments

    paddy_deburca’s picture

    The following string should read as <ul></ul>

    chx’s picture

    Status: Active » Needs review
    FileSize
    566 bytes

    While we are here, what about moving the whole thing into !empty($items). Do we want a div and a title when there is no list?

    killes@www.drop.org’s picture

    chx: I'd appreciate this, it has annoyed me for a long time.

    chx’s picture

    FileSize
    987 bytes
    drumm’s picture

    Looks good. +1

    chx’s picture

    Status: Needs review » Reviewed & tested by the community

    get this puppy in

    Dries’s picture

    Status: Reviewed & tested by the community » Fixed

    Committed to HEAD. Thanks.

    Anonymous’s picture

    Status: Fixed » Closed (fixed)