Installation and deployment Questions on installation, system configuration and deployment to the live server.
Version 6.x > Installation and deployment > Null GUID in GetLinkUrl() return value in Transformation View modes: 
User avatar
Member
Member
jeff.magill-fleishman - 7/24/2012 4:40:37 PM
   
Null GUID in GetLinkUrl() return value in Transformation
I am creating a new transformation for Page (menu item). I am using the document's Teaser image field so copied the CMS.MenuItem.ImageGalleryList code to a new transformation and customized the markup. Of course I uploaded teaser images for all the pages also.

<div class="our">
<img src="<%# GetFileUrl("MenuItemTeaserImage") %>" alt="<%# Eval("DocumentName",true) %>" />
<div class="our_pop_cont">
<div class="pop_up">
<h5><%# Eval("DocumentName") %></h5>
<a href="<%# GetDocumentUrl() %>" class="pop_up_link"></a>
</div>
</div>
</div>

The markup that this produces is like:

<img alt="My Page Name" src="/getattachment/00000000-0000-0000-0000-000000000000/My-Page-Name.aspx">

...which produces a 404. I went into the database and found an actual GUID set for one of the [CONTENT_MenuItem].[MenuItemTeaserImage] pages and manually swapped that in for the null GUID and the image loaded successfully!

/getattachment/C0E089A1-2B17-4490-B462-A41380E6ABC3/My-Page-Name.aspx

So, I started with "official" Kentico code. I uploaded the image and it made it into Kentico. The image is getting served correctly (when the correct URL is requested). However, <%# GetFileUrl("MenuItemTeaserImage") %> does not produce the correct URL.

Am I doing something wrong? How do I get the correct URL for the MenuItemTeaserImage?

User avatar
Member
Member
jeff.magill-fleishman - 7/24/2012 4:48:40 PM
   
RE:Null GUID in GetLinkUrl() return value in Transformation
Maybe I should add that when I render the MenuItems with the ImageGalleryList transformation, I get the same bad links.

User avatar
Kentico Developer
Kentico Developer
kentico_ivanat - 7/24/2012 9:14:37 PM
   
RE:Null GUID in GetLinkUrl() return value in Transformation
Hi,

before I try to reproduce this issue, could you please confirm that you have you tried simple method?
<%# GetImage("imageColumnName")%>

Thank you.

Best regards,
Ivana Tomanickova

User avatar
Certified Developer v7
Certified  Developer v7
kcollins - 7/25/2012 8:33:01 AM
   
RE:Null GUID in GetLinkUrl() return value in Transformation
I'm experiencing this same issue. Version 6.0.37.
<%# GetImage("MenuItemTeaserImage") %> produces no result.
<%# Eval("MenuItemTeaserImage") %> produces no result.

<%# GetFileUrl("MenuItemTeaserImage") %> produces /getattachment/00000000-0000-0000-0000-000000000000/filename.aspx


User avatar
Kentico Support
Kentico Support
kentico_zdenekc - 7/31/2012 6:49:44 AM
   
RE:Null GUID in GetLinkUrl() return value in Transformation
Hello,

If <%# Eval("MenuItemTeaserImage") %> or even
<%# Eval("MenuItemTeaserImage").ToString() %>

produces no result, it means that either the value is not defined (is null/empty), or the listing web part loads multiple classnames (document types) and the general View_CMS_Tree_Joined is used instead of the Page(MenuItem) specific - View_CONTENT_MenuItem_Joined. The general view doesn't contain the MenuItemTeaserImage field, so the result of the methods will be empty or invalid.

Could this be the cause in your setups?

If yes, the solution would be either to use just Page(MenuItem) or write a custom JOIN query and use it in the Custom query repeater (datalist).

Regards,
Zdenek

User avatar
Member
Member
jeff.magill-fleishman - 7/25/2012 10:54:42 AM
   
RE:Null GUID in GetLinkUrl() return value in Transformation
<%# GetImage("MenuItemTeaserImage") %>

This produces no markup.

User avatar
Member
Member
jeff.magill-fleishman - 7/25/2012 10:55:54 AM
   
RE:Null GUID in GetLinkUrl() return value in Transformation
I am on v6.0.23 (SP1).

User avatar
Member
Member
eng.rupalikulkarni-gmail - 10/18/2012 12:17:13 PM
   
RE:Null GUID in GetLinkUrl() return value in Transformation
Hi,


I am also facing the same problem, And i am using Version 7 of Kentico.

Can anyone please suggest solution for this problem?


Thanks!

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 10/19/2012 2:17:49 AM
   
RE:Null GUID in GetLinkUrl() return value in Transformation
hi,

What field type are you using in the document typoe and what are you using in the transformation?

Best regards,
Juraj Ondrus

User avatar
Member
Member
alexander.moeslinger-timewarp - 11/14/2012 3:52:53 AM
   
RE:Null GUID in GetLinkUrl() return value in Transformation
is there already any solution?

i have the same issue using document uploader (field type) and GetDocumentUrl/GetFileUrl in the transformation (v6.0.4297).

With File Uploader (field type) i get the right GUID BUT the file does not open correctly (just white background...)

for example: www.mydomain.com/getattachment/b4eed642-838f-4f3b-b1a0-fdf5ff34d158/my-file.aspx (nothing happens)....

Thx for your help!

best regards,

alex

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 11/14/2012 5:05:28 AM
   
RE:Null GUID in GetLinkUrl() return value in Transformation
Hi,

What is the exact field type - is it a document selector, file upload, direct uploader?

Best regards,
Juraj Ondrus

User avatar
Member
Member
alexander.moeslinger-timewarp - 11/14/2012 5:09:29 AM
   
RE:Null GUID in GetLinkUrl() return value in Transformation
as i wrote:

document selector does not get any GUiD (0000-0000....)

and file upload gets the guid but does not open any file (see my last post)

thx

regards

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 11/14/2012 5:19:39 AM
   
RE:Null GUID in GetLinkUrl() return value in Transformation
Hi,

I was confused by your last post since there is no document uploader field. The document selector selects documents, not files and it is not storing the GUID of the file.

What function are you using for the file upload field? It is not clear from your post what exactly and how are you using.

Best regards,
Juraj Ondrus

User avatar
Member
Member
alexander.moeslinger-timewarp - 11/14/2012 5:41:21 AM
   
RE:Null GUID in GetLinkUrl() return value in Transformation
sorry, i meant document attachment. I tried direct uploader/upload file and Document attachments control


anyway, i just want to offer a download link on my website and have a transformation like this:

<a href="<%# GetFileUrl("MyFile") %>" target="_blank"> Download <%# Eval("DocumentName") %> (pdf, ca. 700 KB)</a>

But all i get is a link like that:

www.mydomain.com/getattachment/b4eed642-838f-4f3b-b1a0-fdf5ff34d158/my-file.aspx (nothing happens)

and this does not work?!

any suggestions?

is there also a possibility to get the file size?

thx

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 11/14/2012 5:57:54 AM
   
RE:Null GUID in GetLinkUrl() return value in Transformation
Hi,

My field is attribute type "File", form control "Upload file" and I am using exactly the same transformation to download/open e.g. the PDF file. Have you tried different browser or PDF file? This seems to me more like browser issue when opening/downloading the PDF or, it has happened that the PDF file was generated in some non-standard way with some odd header, and the browser is unable to open it.

You can test the transformation e.g. by uploading some image or text file.

Best regards,
Juraj Ondrus

User avatar
Member
Member
alexander.moeslinger-timewarp - 11/14/2012 6:10:11 AM
   
RE:Null GUID in GetLinkUrl() return value in Transformation
i will test it and post my results...thank you for the quick answers!

regards

User avatar
Member
Member
alexander.moeslinger-timewarp - 11/14/2012 6:36:51 AM
   
RE:Null GUID in GetLinkUrl() return value in Transformation
now it works:

images: both with direct uploader and file upload...

pdf: i thought it does not work with pdf's BUT it seems to be a Firefox problem (as you suggested)...pdf-files work in Safari...

thx for your help!

fyi: firefox 16.0.2

best regards