Foros de discusión

Display Page weird logic with Searches

thumbnail
Michele Zanarotti, modificado hace 8 años.

Display Page weird logic with Searches

Junior Member Mensajes: 94 Fecha de incorporación: 20/02/12 Mensajes recientes
Analyzing the code of Liferay 6.2 I saw a very subtle behaviour with searches and view in context.

Basically 'View in Context' is ignored when the target display page (of a resulting web content) contains a search portlet too with a 'link to page' set.

Step to reproduce
- You must have a search form in page 1.
- You must have page2 with an asset publisher (set as default) and another search form too.
- Both the search forms use a 'link to page' to a third page (page3) used for displaying search results
- Create a journal article and set the display page to 'page 2'
- All searches are set with 'View in context'

Whenever you are you expect to click on a link to the article and you'll be brought to page 2 (the display page of the article). This is working well with asset publishers.

But ...
If you come from a search result the logic is different: if the display page of web content contains a search also, the final URL of the detailed content will be ignored and any detailed view will go on the page 3 (the same result page) showing the details of the web content.

I can't file it as a BUG in JIRA because it is clearly coded as intentional in the JournalArticleAssetRenderer.getURLViewInContext() method.

Do you think it's a bug ? how can I put a search in a page that act also as display page for some contents ?