Nov 092006

Remember that wonderful new scheme for parsing URLs? Well, it broke virtual categories. That’s only because I forgot about them. Not because the schema is broken. It will still work, for any item in the tree. But virtual categories are not in the tree. I’ll change the new code to do some extra checks before returning a 404.

Diane Bruce reported this issue…

I just wanted to point out that as a result of this bugfix, I improved the way ports, categories, and non-ports are handled by the missing.php script. I also found a bug with URL such as this: No commits were being shown. It seems I forgot to upgrade a data type like this:

  DROP TYPE element_type CASCADE;
CREATE TYPE element_type AS (
        id               integer,
        name             text,
        type             text,
        status           text,
        iscategory       boolean,
        isport           boolean,
        element_pathname text

CREATE OR REPLACE FUNCTION elementGet (text) RETURNS SETOF element_type AS '
   SELECT id,
          case when IsCategory(Pathname_ID($1)) IS NULL THEN FALSE ELSE TRUE END,
          case when IsPort(    Pathname_ID($1)) IS NULL THEN FALSE ELSE TRUE END,
     FROM element
    WHERE id = PathName_ID($1);


Make sense? I added element_pathname to the element_type data set. I needed that for some of the URL parsing.

Next step: add proper pagination to category listings. It’s there now, but it’s not using Pear/Pager.

Website Pin Facebook Twitter Myspace Friendfeed Technorati Digg Google StumbleUpon Premium Responsive

  One Response to “Virtual Categories are broken!”

  1. Fixed. Thank you Diane.