Forums

Home » Liferay Portal » English » x. Miscellaneous

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Marco Ferretti
Multiple copies of the same content ( with same version )
October 17, 2012 12:47 AM
Answer

Marco Ferretti

Rank: Junior Member

Posts: 69

Join Date: October 4, 2010

Recent Posts

Hi all

I have two instances of a Liferay 6.0.6 CE in which I am facing an issue that looks related to LPS-16320 : I am seeing multiple copies of the same content ( same version ) in RSS portlet and Web Content List portlet. To add more fuzzyness, if I order the content in the web content management ( control panel ) portlet by something that is not modified date the duplicates disappear from web content list but not from rss feed portlet.

I have asked in the JIRA for references to the patch but I was told that it has been fixed in LF 6.1.1 which, at the moment, is not an option for us. I checked out from git and looked for references to LPS-16320 in the code
1
2~/devel/git/liferay-portal$ find . | xargs grep "LPS-16320"

but found no references.

Is there anyone out there that maybe can help me point out the parts I need to integrate in the code in order to fix this ?

TIA
~marco
Hitoshi Ozawa
RE: Multiple copies of the same content ( with same version )
October 17, 2012 4:46 AM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7949

Join Date: March 23, 2010

Recent Posts

I think it was a bug with rome.jar which Liferay uses in RSS portlet. I think they just applied a patch to the rome source so it really wasn't a liferay patch.
Marco Ferretti
RE: Multiple copies of the same content ( with same version )
October 17, 2012 5:24 AM
Answer

Marco Ferretti

Rank: Junior Member

Posts: 69

Join Date: October 4, 2010

Recent Posts

Hitoshi Ozawa:
I think it was a bug with rome.jar which Liferay uses in RSS portlet. I think they just applied a patch to the rome source so it really wasn't a liferay patch.



Hi

It looks like my is a "double" issue. The web content bit was resolved thanks to the help of topolik applying this patcht : https://github.com/liferay/liferay-portal/commit/cb2f8a8e31e6870b94d2fb7fa74f2726c011f34c.

As of the RSS : I am debugging right now and it looks like the rows from the JournalArticle table are not grouped by when calling the RSS
 1
 2                StringBundler sb = new StringBundler("id_ AS id");
 3
 4                for (String field : orderByComparator.getOrderByFields()) {
 5                    sb.append(", ");
 6                    sb.append(field);
 7                }
 8
 9                sql = StringUtil.replace(sql, "id_ AS id", sb.toString());
10
11                sql = StringUtil.replace(
12                    sql, "(version = ?) [$AND_OR_CONNECTOR$]", "");
13            }


ths is the result of the evaluation of the SQL before applying the parameters : http://pastebin.com/2VqMEwgf


~marco
Marco Ferretti
RE: Multiple copies of the same content ( with same version )
October 17, 2012 6:08 AM
Answer

Marco Ferretti

Rank: Junior Member

Posts: 69

Join Date: October 4, 2010

Recent Posts

Ok, I have been debugging with topolik up until now and it looks like the version parameter is never set in JournalRSSUtil.getArticles(JournalFeed feed) : it is declared as null in there and never modified during the chain of calls down to JournalArticleFinderImpl.findByC_G_A_V_T_D_C_T_S_T_D_S_R ;

This means that the JournalArticleFinderImpl will return all the versions of the articles .
Setting the value to -1d in JournalRSSUtil results in JournalArticleFinderImpl to return the latest version of the articles.

A doubt : I just checked the latest version ( 6.1.x ?) of JournalRSSUtil in github and it looks like the setting of the version parameter to null is still there ... is it a wanted behavior or something that just slipped through the controls and I can safely patch it ?



TIA


~marco
Marco Ferretti
RE: Multiple copies of the same content ( with same version )
October 17, 2012 6:47 AM
Answer

Marco Ferretti

Rank: Junior Member

Posts: 69

Join Date: October 4, 2010

Recent Posts

Forget it. It makes total sense to feed all the versions ... it's the client job to show the last updated revision.
Will have a look at the rome.jar bit as suggested by Hitoshi
Hitoshi Ozawa
RE: Multiple copies of the same content ( with same version )
October 17, 2012 3:45 PM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7949

Join Date: March 23, 2010

Recent Posts

After re-reading you post, the bug you've found may be different from the one I thought it was. It may be something more to the following. Try testing if you're getting multiple copies when there's only one version of the content.

https://issues.liferay.com/browse/LPS-6643

Liferay.com staff shouldn't have just transferred the problem to the community. They should have said that they offer support service for a fee. We do too. I'm not sure if liferay.com is providing just patches over the GA releases, but we do have a patched up versions of liferay ready to use.
Marco Ferretti
RE: Multiple copies of the same content ( with same version )
October 18, 2012 1:25 AM
Answer

Marco Ferretti

Rank: Junior Member

Posts: 69

Join Date: October 4, 2010

Recent Posts

Hi

I am testing several cases right now but it looks like there was something messed up in the test feed : i re-created it from scratch and it seems to be working as expected now.I Anyways, it looks a lot more a problem of configuration of the portlet rather than the feed since, as I said before, it works flawlessly when viewed with another rss reader ( tested with lifera ) .

Also, my users are telling me that it used to work on version 5 thus I downloaded the sources and compared them ... and ( at least for the portlet ) the difference look minimal ( mostly alloy related ) .

will keep you posted.


~ marco