[TECHNICAL SUPPORT] LPS-34846 Fixed groupId and type extraction logic when article is found

Hi Ray,

I'm pasting Vilmos' comment below, however, I've changed the code a bit. Correct me if I'm wrong, but I cannot see any reason why we should set the groupId again any time, as it's handled in the init.jps. In addition, if we change this to the chosen article's groupId why should we set this back right after. As I can see it's done in the http://issues.liferay.com/browse/LPS-12920 ticket.

As for the type, I changed the behavior according to the groupId's handling.

Vilmos' comment:

"There was a bug in the logic we extracted groupId and type variables in the configuration of Web Content Display. This caused inconsistent working when the originally selected article was selected from the Global scope. The problem was that we always overrode the groupId with the request's groupId or the themeDisplay.getScopeGroupId() even though we successfully loaded it from the prefenreces and/or from the article.getGroupId()."

Regards,
Zsigmond