PUBLIC - Liferay Portal Community Edition
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-8170

Journal preview is not working when you edit an article on another group

    Details

    • Similar Issues:
      Show 5 results 

      Description

      "com.liferay.portlet.journal.NoSuchTemplateException: No JournalTemplate exists with the key ..." is thrown because wrong groupId is passed to preview

        Activity

        Hide
        Brian Chan added a comment - - Restricted to

        Hey Zsolt,

        I rolled this back because Eduardo mentioned the themeDisplay.getScopeGroupId() should be correct.

        I also noticed that themeDisplay.getScopeGroupId() is used several more times in that file and not sure why this same pattern wouldn't need to be applied there as well?

        Show
        Brian Chan added a comment - - Restricted to Hey Zsolt, I rolled this back because Eduardo mentioned the themeDisplay.getScopeGroupId() should be correct. I also noticed that themeDisplay.getScopeGroupId() is used several more times in that file and not sure why this same pattern wouldn't need to be applied there as well?
        Hide
        Eduardo Lundgren added a comment - - Restricted to

        Hi Zsolt,

        I tested with an structured article and it's passing the correct groupId to the URL using themeDisplay.getScopeGroupId(). I cannot reproduce the error. Can you test it again? If the error persists can you write the steps how to reproduce it?

        http://localhost:8080/c/journal/view_article_content?cmd=preview&groupId=10144&articleId=10414&version=1.0&languageId=en_US&type=general&structureId=10410&templateId=TESTINGSTRUCTURE
        NOTE: the groupId=10144

        In addition, next time you edit big files like that, add a comment on the ticket saying the reason you only changed the "themeDisplay.getScopeGroupId()" in one place, because this is being used in a lot of other places on the same file. I understood you only changed on that piece because it was related to the "preview" action, although it might be harder for another people who is not used with the WebContent display.

        Show
        Eduardo Lundgren added a comment - - Restricted to Hi Zsolt, I tested with an structured article and it's passing the correct groupId to the URL using themeDisplay.getScopeGroupId(). I cannot reproduce the error. Can you test it again? If the error persists can you write the steps how to reproduce it? http://localhost:8080/c/journal/view_article_content?cmd=preview&groupId=10144&articleId=10414&version=1.0&languageId=en_US&type=general&structureId=10410&templateId=TESTINGSTRUCTURE NOTE: the groupId=10144 In addition, next time you edit big files like that, add a comment on the ticket saying the reason you only changed the "themeDisplay.getScopeGroupId()" in one place, because this is being used in a lot of other places on the same file. I understood you only changed on that piece because it was related to the "preview" action, although it might be harder for another people who is not used with the WebContent display.
        Hide
        Zsolt Balogh added a comment - - Restricted to

        Hey Eduardo,

        The themeDisplay.getScopeGroupId() is only filled on the Control Panel, but if you click the edit article button on a WCD portlet, you won't be able to preview. I've modified to use the form's groupId, because it contains always the scopeId, so it would work everywhere.

        Zsolt

        Show
        Zsolt Balogh added a comment - - Restricted to Hey Eduardo, The themeDisplay.getScopeGroupId() is only filled on the Control Panel, but if you click the edit article button on a WCD portlet, you won't be able to preview. I've modified to use the form's groupId, because it contains always the scopeId, so it would work everywhere. Zsolt
        Hide
        Zsolt Balogh added a comment -

        I'll need to retest later, not it seems to work. I was testing staging when I've found this issue, so it might be also involved.

        Show
        Zsolt Balogh added a comment - I'll need to retest later, not it seems to work. I was testing staging when I've found this issue, so it might be also involved.
        Hide
        Zsolt Balogh added a comment -

        To reporoduce the problem, you need to put a structured article from another community into a WCD portlet and hit the preview button.

        Show
        Zsolt Balogh added a comment - To reporoduce the problem, you need to put a structured article from another community into a WCD portlet and hit the preview button.
        Hide
        Jorge Ferrer added a comment -

        I think Zsolt's solution should be fine. In most scenarios the value of the groupId will be the same as the one from themeDisplay.getScopeGroupId(), but the one obtained from the article also accounts for articles being published from the global scope.

        Show
        Jorge Ferrer added a comment - I think Zsolt's solution should be fine. In most scenarios the value of the groupId will be the same as the one from themeDisplay.getScopeGroupId(), but the one obtained from the article also accounts for articles being published from the global scope.
        Hide
        Jorge Ferrer added a comment - - Restricted to

        Thanks Eduardo,

        I haven't had time to test it, but by looking at the code it looks good.

        Show
        Jorge Ferrer added a comment - - Restricted to Thanks Eduardo, I haven't had time to test it, but by looking at the code it looks good.

          People

          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:
              Days since last comment:
              4 years, 51 weeks, 3 days ago

              Development

                Structure Helper Panel