掲示板

Assets access problem on private pages

9年前 に Paul Allain によって更新されました。

Assets access problem on private pages

Junior Member 投稿: 77 参加年月日: 13/09/03 最新の投稿
Hello,

I have added some images to the documents and media in the control panel as one would normally do. the problem I am having is that when I try to access these images on the private pages of a website I am getting blank thumbnails and can't add them to a blog entry for example.

The images work fine on the public pages of the site.

Why is the private site misbehaving this way? Or is this a feature? Am I missing something?

Thanks
Paul
thumbnail
9年前 に Olaf Kock によって更新されました。

RE: Assets access problem on private pages

Liferay Legend 投稿: 6403 参加年月日: 08/09/23 最新の投稿
Please compare the URLs that the images are requested from, in both cases. Probably they're relative to the current page - e.g. you might have a public page named /web/guest/home and a private page named /group/guest/some/nested/hierarchy. If they address the image through <img src="../../documents/12/345/my-image.png"/> this would be the reason for the image not to be found.

Change the path to be server relative (e.g. /documents/12/.....) and it should work from everywhere.

As the article is just referencing the image, but happens to be displayed on a page with a certain URL (that the article does not know of) this is a natural limitation that needs to be addressed in the way images are referenced from an article.
9年前 に Paul Allain によって更新されました。

RE: Assets access problem on private pages

Junior Member 投稿: 77 参加年月日: 13/09/03 最新の投稿
Hello and thanks for your reply,

Yes I've had a close look at the way the URLs for the image are constructed but could not spot anything obvious in that respect.

Here are the image's URLs for the public and private pages respectively:

<p id="yui_patched_v3_11_0_1_1403716198033_1020">
<img alt="" id="yui_patched_v3_11_0_1_1403716198033_1019" src="/documents/11831/13914/finding-mum-feature.jpg/f2aac19f-5e6d-46f0-84a5-a67a2a53c564?t=1396424235000">&nbsp;</p>

<p id="yui_patched_v3_11_0_1_1403716198033_1020">
<img alt="" id="yui_patched_v3_11_0_1_1403716198033_1019" src="/documents/11831/13914/finding-mum-feature.jpg/f2aac19f-5e6d-46f0-84a5-a67a2a53c564?t=1396424235000">&nbsp;</p>


As can be seen above they are, in fact, identical.

One thing worth mentioning is that I have the public and private areas of the site mapped to different DNS entries in the following format: http://www.mysite.com for the public and http://private.mysite.com for the private pages, not sure if this has any implications on how the links are resolved but the image source link seem to be in a global format.

Also when I point the browser to the public link (see bellow) I get the image, however, when I try accessing it through the private site I get 'status not found" error portlet.

http://www.mysite.com/documents/11831/13914/finding-mum-feature.jpg/f2aac19f-5e6d-46f0-84a5-a67a2a53c564?t=1396424235000


Any further ideas to point me in the right direction to carry on investigating would be appreciated.

Paul
thumbnail
9年前 に Olaf Kock によって更新されました。

RE: Assets access problem on private pages

Liferay Legend 投稿: 6403 参加年月日: 08/09/23 最新の投稿
Then it looks like you're running into issues with different sites/pages...

The first id after /document/s, in your case 11831 is the site id.

Do these public and private pages belong to the same site, e.g. the one with id 11831? Which version of Liferay are you running?
9年前 に Paul Allain によって更新されました。

RE: Assets access problem on private pages

Junior Member 投稿: 77 参加年月日: 13/09/03 最新の投稿
Yes the pages are public and private pages of the same site.

Currently running on Liferay 6.2 GA2.
thumbnail
9年前 に Olaf Kock によって更新されました。

RE: Assets access problem on private pages

Liferay Legend 投稿: 6403 参加年月日: 08/09/23 最新の投稿
Ok, I can reproduce this. Can't explain, other than as a bug. Unless I'm missing the obvious - then I'd like to be corrected...

Are you on CE or EE?
9年前 に Paul Allain によって更新されました。

RE: Assets access problem on private pages

Junior Member 投稿: 77 参加年月日: 13/09/03 最新の投稿
I am currently on CE.

Hope there could be a workaround between now and when a bug fix is produced.

Cheers
thumbnail
9年前 に Olaf Kock によって更新されました。

RE: Assets access problem on private pages

Liferay Legend 投稿: 6403 参加年月日: 08/09/23 最新の投稿
Suggested workaround: Either have fully qualified (including server name) URL for image, or explicitly map/rewrite document-library URLs on the frontend server