Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Releases and Announcements

Latest news about the SilverStripe software.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

2.3RC4 -> Undocumented backwards incompatiblity with Image->URL


5 Posts   2105 Views


22 February 2009 at 5:56am Community Member, 787 Posts

For I use GD quite a lot to re-size images and add watermarks to them.

After upgrading the site to 2.3rc4 , the watermarks stopped working ..

It seems the value of the URL property of the Image class has changed.. From 2.3 on , it returns a relative path instead of a full absolute address. This breaks backwards compatibility.

I can't find anything about it in the docs (maybe I'm not look in the right places), but before I post a ticket, can anyone confirm this behaviour for me ?

Testcase :


class Bla extends Image {
return $this->URL;

returns : or something like that..

Where in 2.3 it returns just


Thanks !


24 February 2009 at 8:34pm Forum Moderator, 801 Posts

There was indeed some tricky deprecation for Image->URL. Relevant changesets from 11 months ago:

$image->URL should call $image->getURL(), which gives you a relative link in 2.3 - so not sure why this fails...

Did you subclass image, and perhaps added a $db property called URL?

I've also found out that File->getURL() actually returns the absolute URL - this inconsistency needs to be fixed, I've opened a ticket:


24 February 2009 at 9:04pm Community Member, 787 Posts

>$image->URL should call $image->getURL(), which gives you a relative link in 2.3 - so not sure why this fails...

Well yeah, that is indeed what it does.. ;-) But in 2.2.3 , it returned an absolute link .. I think it should be noted in the upgrade-documentation that this is going to happen , because it took me quite some time to figure out why my site got killed.. That is all.. ;-)


24 February 2009 at 9:57pm Forum Moderator, 801 Posts

Lol, yeah got myself confused there ;) Added a note to

I should've marked the original commit as "API CHANGE", in which case it wouldn't have gone unnoticed in compiling the upgrade warnings.


24 February 2009 at 10:02pm Community Member, 787 Posts


thanks !