contao / core

Contao 3 → see contao/contao for Contao 4
GNU Lesser General Public License v3.0
492 stars 213 forks source link

An Event's imageUrl Field Overwrites It's Event Link #6468

Closed beaniemonk closed 10 years ago

beaniemonk commented 10 years ago

You can reproduce this in the demo by adding an image to an event and entering a link target (I used http://www.google.com).

In addition to the image being linked, the event's actual redirect link ($this->href) is also changed to the image's link target as well.

leofeyer commented 10 years ago

I cannot reproduce the issue. All the event links pointed correctly to the event reader page on my system. Only the image was linked to google.com.

beaniemonk commented 10 years ago

Hi Leo,

I just tried it again on the online demo. I went into Music Academy Events, edited the "Winter Holiday" event by adding an image (picked a random one from site files). And entered "http://www.google.com" and the image link target.

Then I went to this front-end page: http://demo.contao.org/en/events.html?month=201001

When I hover over any of the "Winter Holiday" events, all of the headlines are linked to Google.

I've attached a couple screenshots to (hopefully) prove I'm not crazy. :)

be fe

xchs commented 10 years ago

I can reproduce the issue. Either way there is a problem with the whole event teaser image. Actually, it seems that the event teaser does not handle it properly.

leofeyer commented 10 years ago

Fixed in 08ea58391183f9259f8b7b2dc510def2525e9ae5. The image link is now stored as $this->imageHref and does not override $this->href (the event details URL) anymore.

aschempp commented 10 years ago

What about changing the href of events instead of changing the behavior of the universal function, which will eventually affect other modules?

leofeyer commented 10 years ago

Image links in events are very rare, so the change affects only very little installations. The core templates do not use teaser images at all, so the majority of users without customized templates are not affected either. This way the change only has a minimum impact.

And by the way, if there really were another module relying on the href property, its value would be overridden by the method as well, rendering the routine broken. But then we would have known much earlier, because this issue has been in the code for quite some time :)