[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Libreplanet-dev] Calendar extension error
From: |
Peter |
Subject: |
Re: [Libreplanet-dev] Calendar extension error |
Date: |
Wed, 17 Jun 2009 09:19:38 +0000 |
User-agent: |
KMail/1.8.2 |
On Tuesday 16 June 2009 16:14, you wrote:
> Peter <address@hidden> writes:
> > On Monday 15 June 2009 07:21, you wrote:
> >> On Sat, 2009-06-13 at 06:51 +0000, Peter wrote:
> >> > Hi,
> >> >
> >> > The current event page returns an error, line 172 in
> >> > Calendar/common.php
> >> >
> >> > My suggestion is to insert between
> >> >
> >> > $img = Image::newFromName( $name );
> >> > $path = str_replace("\\", "/", $_SERVER['DOCUMENT_ROOT']) .
> >> > $img->getURL();
> >> >
> >> > the following
> >> >
> >> > $img = Image::newFromName( $name );
> >> > if ( !is_object( $img))
> >> > return null;
> >> > $path = str_replace("\\", "/", $_SERVER['DOCUMENT_ROOT']) .
> >> > $img->getURL();
> >> >
> >> > The is_object notes can be found at http://us3.php.net/is_object
> >> >
> >> > If that works, we can submit a bug?
> >> >
> >> > Regards,
> >> >
> >> > Peter
> >>
> >> Sorry, this is my fault.
> >>
> >> I tried to insert a new event on June 20th.
> >> I think the fact that there was already an event on that date caused the
> >> error.
> >
> > Well then thats a bug because it should handle several events for a day.
> > The problem is in a new event list function. I think it assumed your link
> > was an icon and tried to get the image. However, it fails to check
> > whether the icon exists before using it.
>
> The bug is actually that events can't have links on the first line (and
> possibly not other types of markup as well) because the first line is
> used as the name of the event in the calendar view.
I disagree. The bug is Calendar does not check the first line properly. It
must validate all data before using it, that is programming 101.
A much better approach would be to add an <event title="Event name"
icon="event/icon.png"/> tag, which users can put anywhere on the event page.
Calendar can search for it and properly parse it.
Better yet, allow a single page to have several event tags and either combine
them into one calendar event, or display them separately.
By using a tag, Calendar will be able to identify the event information and
validate it properly. Users will be able to edit the event page as they like
without compromising calendar, or the website. Pages without event tags can
be flagged in calendar as 'invalid event', so users can move or fix the page.
>
> I fixed this particular one, but any fix to the extension itself would
> be most welcome.
By 'fixed' do you mean you changed the event page, or calendar code?
I _have_ _already_ offered my patch, has it been applied? It was submitted
about 5 days ago. If this is the wrong place to submit patches, please point
me to the right place.
>
> We should probably also add an instruction somewhere (an event template
> perhaps?) that says to use the first line as a title and not a link.
Actually, Calendar _does_ expect the first line to have link, but doesn't
check it, my patch does that (I hope).
Lets patch the code first and then see if it works with links before annoying
users and exposing the website to more abuse. Please.
Regards,
Peter
- [Libreplanet-dev] Calendar extension error, Peter, 2009/06/13
- Re: [Libreplanet-dev] Calendar extension error, Graziano Sorbaioli, 2009/06/15
- Re: [Libreplanet-dev] Calendar extension error, Peter, 2009/06/15
- Re: [Libreplanet-dev] Calendar extension error, John Sullivan, 2009/06/16
- Re: [Libreplanet-dev] Calendar extension error,
Peter <=
- Re: [Libreplanet-dev] Calendar extension error, John Sullivan, 2009/06/19
- Re: [Libreplanet-dev] Calendar extension error, Peter, 2009/06/20
- Re: [Libreplanet-dev] Calendar extension error, John Sullivan, 2009/06/22
- Re: [Libreplanet-dev] Calendar extension error, Peter, 2009/06/23
- Re: [Libreplanet-dev] Calendar extension error, John Sullivan, 2009/06/23