Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-12203

Event handlers are not called for static portlets

    Details

    • Branch Version/s:
      6.0.x, 5.2.x, 5.1.x
    • Backported to Branch:
      Committed
    • Liferay Contributor's Agreement:
      Accept

      Description

      While implementing integration through events on our custom liferay portal I found that the portlets event handler is not called although the event was being published.

      After debugging a bit I found the following code:

                      for (Event event : events) {
                              javax.xml.namespace.QName qName = event.getQName();
      
                              for (LayoutTypePortlet layoutTypePortlet : layoutTypePortlets) {
                                      List<Portlet> portlets = layoutTypePortlet.getPortlets();
      
                                      for (Portlet portlet : portlets) {
                                              QName processingQName = portlet.getProcessingEvent(
                                                      qName.getNamespaceURI(), qName.getLocalPart());
      
                                              if (processingQName != null) {
                                                      processEvent(
                                                              portletRequestImpl, stateAwareResponseImpl,
                                                              layoutTypePortlets, layoutTypePortlet, portlet,
                                                              event);
                                              }
                                      }
                              }
                      }
      

      The layoutTypePortlet.getPortlets() does not include the static portlets, so the event handlers on these portlets are never invoked.

      Using layoutTypePortlet.getAllPortlets() instead would fix this. Attaching patch.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              igor.spasic Igor Spasic (Inactive)
              Reporter:
              pedro.guedes Pedro Guedes (Inactive)
              Participants of an Issue:
              Recent user:
              Esther Sanz
              Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Days since last comment:
                7 years, 45 weeks, 6 days ago

                  Packages

                  Version Package
                  --Sprint - SP
                  6.1.0 CE RC1