contao/import — Issue #2445: Change in rev 534 causes odd behaviour in Frontend::addToUrl()
Author: importer
Created: 2011-11-29 19:35:11+00:00
State: open
Labels: calendar, Defect

The changes in http://dev.contao.org/projects/typolight/repository/diff/tags/contao-2.9.1/system/modules/calendar/ModuleEventlist.php?rev=534&rev_to=62 at the beginning of the compile() routine (line 93) make the function addToUrl in class Frontend nearly unusable now.

The problem is, that ModuleEventList uses $this->Input->setGet() to buffer the date environment it has at the moment of execution but never clears it.

This results in very weird behaviour as every other module that get's rendered after the Eventlist will think the get parameter was given by the browser.

Using Frontend::addToUrl() in those Modules will make them generate links similar to "/somepage/month/201008/moduleparam/modulevalue".

I personally can not see any benefit of forcing modules, that get rendered after the eventlist, to contain the month/year/day value in their urls where the modules rendered before do not.
In fact I was very puzzled to find out some of my modules did generate those links and others did not.

I'd suggest to either change the behaviour back to some local variables to hold the current value of month/year/day instead of setting it in the get parameter or, if that is not in your intention, at least clear the value back when it is not needed anymore (around line 136 seems appropriate).

--- _Originally created by xtra on August 17th, 2010, at 04:27pm (ID 2445)_