Uploaded image for project: 'Hippo CMS'
  1. Hippo CMS
  2. CMS-13117

Expected Hippo Bean not returned when there is an Image Link inside a Content Blocks

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Normal
    • Resolution: Fixed
    • 13.3.0, 14.1.0
    • None
    • plugins-content-blocks
    • None
    • Flagged
    • Pulsar
    • Pulsar 234 - ContentSearch Fin, Pulsar 235 - Eng OKRs

    Description

      A scenario where a content block contains an Image Link (hippogallerypicker:imagelink) or an InstagramImage (ABC:instagram) works perfectly fine when the image link is outside the content block. This issue only happens when the Image Link is inside a content block. So, having an Image Link outside the content block returns the expected HippoBean (Image).

      Below is the current workaround:

      @HippoEssentialsGenerated(internalName = "ABC:images", allowModifications = false)
      public List<HippoBean> getImages() {
          return getChildBeansByName("ABC:images", HippoBean.class);
      }
      
      /**
       * The method return an bean of the allowed types or null.
       *
       * Allowed types are InstagramImage and Image (Image Link)
       */
      public HippoBean getListicleItemImage() {
          HippoBean image = getOnlyChild(getImages());
          if (image instanceof HippoFacetSelect) {
              try {
                  //TODO: This is a workaround to an issue found in the CMS when a content block is composed of Image Links
                  return RequestContextProvider.get().getQueryManager()
                          .createQuery(RequestContextProvider.get().getSession().getNodeByIdentifier(
                                  image.getSingleProperty("hippo:docbase"))).execute().getHippoBeans().nextHippoBean();
              } catch (QueryException | RepositoryException e) {
                  e.printStackTrace();
              }
          }
          return image;
      }

      Attachments

        Activity

          People

            Unassigned Unassigned
            mchhrapru Mohit Chhapru
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: