Trouble with default repository URL?

Mike Baptiste mike@baptistefamily.net
Fri, 23 Nov 2001 12:48:58 -0500


I installed chora 0.6.5-cvs from the CVS repository last night (upgraded
from 0.6.1 when I put horde-2.0RC2 in).  Everything seems to work fine
except for one thing.  I've got 3 repositories defined.  However, in the
'Other Repositories' menu bar, one of the links is always missing the rt
value (which directs chora to the right repository)

Its always the 'default' repository (when you're viewing another
repository so the default on is in the 'Other Repos' list).  Either the
first one in the cvsroots.php file or the one with 'default' => true
defined.  It doesn't matter how teh deault is defined.

I looked around the code, and found this in Chora.php:

      function repositories() {
          global $cvsroot, $cvsroots, $defaultActs;

          $arr = array();
          foreach ($cvsroots as $key=>$val) {
              if ($cvsroot != $val['location']) {
  >>>>>>          $arg = array('rt' => (($defaultActs['rt'] == $key) ? ''
: $key));
                  $arr[] = '<b><a href="' . Chora::url('cvs', '', $arg) .
'">' .
                           $val['name'] . '</a></b>';
              }
          }

I can't quite figure out this line:
$arg = array('rt' => (($defaultActs['rt'] == $key) ? '' : $key));

Basically when it hits the default repository, it always sets rt to ''
which won't work since it still defines rt and puts it in the url.  You
get a 'Malformed URL' error.  Don't we want to drop rt completely?  That
way it just points to cvs.php which will route to the default.  Right?

I guess its nice to try and strip the url for the default repository
down to just /cvs.php/, but is there any reason we don't just set rt anyway?

I tried to get rid of the blank rt, but had trouble - kept getting old
array data from previous iterations (even after doing an unset)  I did
toss in a "if (!$val) { continue; }" in the argument loop of function
url, but that seemed like a kludge (basically skip any key with a blank
value)  I'm sure I'm missing somethign obvious, but for simplicity, I
just changed

$arg = array('rt' => (($defaultActs['rt'] == $key) ? '' : $key));

to

$arg = array('rt' => $key);

and it works fine.  Thougts?

Mike






>From jo@our Date: 23 Nov 2001 19:09:16 -0800
Return-Path: <jo@our-own.net>
Mailing-List: contact chora-help@lists.horde.org; run by ezmlm
Delivered-To: mailing list chora@lists.horde.org
Received: (qmail 95209 invoked from network); 24 Nov 2001 03:09:17 -0000
Received: from mail.our-own.net (209.218.63.68)
  by clark.horde.org with SMTP; 24 Nov 2001 03:09:17 -0000
Received: (qmail 424 invoked from network); 24 Nov 2001 03:09:16 -0000
Received: from unknown (HELO jo.cool.net) (10.0.0.3)
  by 0 with SMTP; 24 Nov 2001 03:09:16 -0000
From: Joakim Ryden <jo@our-own.net>
To: chora@lists.horde.org
Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature";
	boundary="=-OHa78lHpOitIhxCrglsa"
X-Mailer: Evolution/0.99.2 (Preview Release)
Date: 23 Nov 2001 19:09:16 -0800
Message-ID: <1006571356.2687.6.camel@jo.cool.net>
Mime-Version: 1.0
Subject: Undefined index?

--=-OHa78lHpOitIhxCrglsa
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

Hi!

Trying to get chora running - I see the repository, I see no files. I
get this error:


Warning: Undefined index: horde in /var/www/html/horde/chora/cvs.php on
line 89

Fatal error: Call to a member function on a non-object in
/var/www/html/horde/lib/MIME/Viewer.php on line 164

Anybody have any ideas?

Thanks!
Jo


--=-OHa78lHpOitIhxCrglsa
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQA7/w9cMf4iPcNp4x8RAhKFAJ47aWswYhmw2JerSiZV1gaBzZHGewCePaZ7
1Ch7nELnuFg1jCihXfpNe5o=
=devY
-----END PGP SIGNATURE-----

--=-OHa78lHpOitIhxCrglsa--



>From jo@our Date: 23 Nov 2001 20:13:26 -0800
Return-Path: <jo@our-own.net>
Mailing-List: contact chora-help@lists.horde.org; run by ezmlm
Delivered-To: mailing list chora@lists.horde.org
Received: (qmail 96087 invoked from network); 24 Nov 2001 04:13:27 -0000
Received: from mail.our-own.net (209.218.63.68)
  by clark.horde.org with SMTP; 24 Nov 2001 04:13:27 -0000
Received: (qmail 591 invoked from network); 24 Nov 2001 04:13:26 -0000
Received: from unknown (HELO jo.cool.net) (10.0.0.3)
  by 0 with SMTP; 24 Nov 2001 04:13:26 -0000
From: Joakim Ryden <jo@our-own.net>
To: chora@lists.horde.org
In-Reply-To: <1006571356.2687.6.camel@jo.cool.net>
References: <1006571356.2687.6.camel@jo.cool.net>
Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature";
	boundary="=-DSkjYGZI7n/YwVnk0nvp"
X-Mailer: Evolution/0.99.2 (Preview Release)
Date: 23 Nov 2001 20:13:26 -0800
Message-ID: <1006575206.2687.8.camel@jo.cool.net>
Mime-Version: 1.0
Subject: Re: [chora] Undefined index?

--=-DSkjYGZI7n/YwVnk0nvp
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

I'll answer my own question - damn people who ask questions too soon ;)
A CVS checkout was the answer - all is fine and well now. :)

--Jo


On Fri, 2001-11-23 at 19:09, Joakim Ryden wrote:
> Hi!
>=20
> Trying to get chora running - I see the repository, I see no files. I
> get this error:
>=20
>=20
> Warning: Undefined index: horde in /var/www/html/horde/chora/cvs.php on
> line 89
>=20
> Fatal error: Call to a member function on a non-object in
> /var/www/html/horde/lib/MIME/Viewer.php on line 164
>=20
> Anybody have any ideas?
>=20
> Thanks!
> Jo
>=20


--=-DSkjYGZI7n/YwVnk0nvp
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQA7/x5mMf4iPcNp4x8RAmD+AJ4wvTYmZFZwSL/Ak/Kmm2Hbj7jbnACfTRof
YJWPgRHpdkMCg9EDUm88uPk=
=PTb9
-----END PGP SIGNATURE-----

--=-DSkjYGZI7n/YwVnk0nvp--