mediawiki-extensions/mw-calendar

The overwrite parameter is not used for normal events.

Opened this issue · 3 comments

Wiki Version: 1.15
Calendar Version: 3.8.4

Problem:
The overwrite parameter is not used for normal events.

I'm using your extension to import an external iCal calendar file. The
calendar in the wiki is intended just for displaying the calendar data, not
for editing them. Therefore, I've made it read-only and have a script
importing the current calendar regularly. The calendar to import into has
ical=overwrite specified. Even though createNewMultiPage() has an overwrite
attribute, it is not used. This leads to the event page getting the same
information added with each import. Changing line 1296 of Calendar.php like
this fixes this:

$this->createNewMultiPage($page, $summary, $description, "iCal Import",
$bOverwrite);

Original issue reported on code.google.com by johan...@bolarus.de on 25 Sep 2009 at 11:03

Hm, this isn't quite right yet. Because I addded the overwrite inside the 
foreach
loop, it seems that for days with several events, each event overwrites the 
previous
one. The program would need to detect that this page has already been updated 
and
then add the new event data. Not as simple as I thought at first, I'm afraid.

Alternatively, shouldn't the import add a second page "-Event 1", "-Event 2" 
etc.
instead of writing this all to one page?

Original comment by johan...@bolarus.de on 25 Sep 2009 at 11:31

It's been awhile since I added that code, so I'll have to review that logic. 
I'll see
what's going on and post back soon.

Thanks
Eric

Original comment by kenyu73 on 25 Sep 2009 at 12:48

  • Changed state: Review
I've reviewed the code and I believe the reason I didn't overwrite because I 
add all 
events to event -0 and didn't want to delete previous valid imports just as you 
mentioned.

I dont create imports into new event id's because I didnt want a runaway import 
to 
kill the application or have the application reach its max event limitations.

I quick solution would be to add text matching logic that simply ignores 
duplicates.

I'm considering changing the logic to read from a file instead of importing 
data, so 
I'm unsure what I plan to do in the short or long term.

Thanks for the information!
Eric

Original comment by kenyu73 on 16 Nov 2009 at 11:13

  • Changed state: Accepted