Josh Larios
-
9/14/2009 3:06:38 PM
Linked attachments break when containing page moves or is renamed
On our site, we're not using permanent URLs, and we are using extensionless URLs.
In general, when we create a page with images, the images are saved as attachments to the document on which they'll be displayed.
If I create a page (say, /catalog/test-1), attach an image (logo.gif) and include that image on the page, the InsertImageOrMedia selector inserts the URL as "/getattachment/catalog/test-1/logo.gif".
If I then move that page to another part of the site, say to /careers/test-1, the image no longer displays, even if I have "Remember original URLs when moving documents" enabled. The old URL continues to work for the page itself, but the attachments no longer work. That is: /careers/test-1 and /catalog/test-1 are both still valid URLs, but /getattachment/catalog/test-1/logo.gif (what the media selector inserted) is no longer valid, while /getattachment/careers/test-1/logo.gif is.
This also happens if I change the document alias using the Properties -> URLs tab.
I don't know if the best way to fix this would be to scan the document contents for references to "getattachment" and rewrite them when the document's properties change, or if the attached objects should have aliases added, or what. But as it is, while attachments are a very cool addition to Kentico, they don't work for us in a critical way.
Maybe if there were an inline control that replaces a guid with the current document alias, the InsertImageOrMedia selector could insert that, so that the links would be resolved at runtime, rather than at the time of insertion. I dunno.
|