Uploaded image for project: 'CMS'
  1. CMS
  2. CMS-6313

Link of existing content in another site

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • 3.5.6, 3.7.2, 3.8.1, 4.0M7
    • None
    • None
    • None

      insert existing content in abstract or link view does not display links when the content comes from another site.

          [CMS-6313] Link of existing content in another site

          Fix not note that you need to rebuild a live workspace

          Laurence Aumeunier added a comment - Fix not note that you need to rebuild a live workspace

          Olivier Gehin added a comment -

          Don't work on 3.8. We get only content title, without link.

          Olivier Gehin added a comment - Don't work on 3.8. We get only content title, without link.

          Here is a patch to test

          Index: main/plugin-web/src/org/ametys/web/content/ContentPagesGenerator.java
          ===================================================================
          --- main/plugin-web/src/org/ametys/web/content/ContentPagesGenerator.java	(revision 31506)
          +++ main/plugin-web/src/org/ametys/web/content/ContentPagesGenerator.java	(working copy)
          @@ -33,6 +33,7 @@
           import org.ametys.plugins.repository.AmetysObjectResolver;
           import org.ametys.plugins.repository.AmetysRepositoryException;
           import org.ametys.plugins.repository.version.VersionableAmetysObject;
          +import org.ametys.web.repository.content.SharedContent;
           import org.ametys.web.repository.content.WebContent;
           import org.ametys.web.repository.page.Page;
           import org.ametys.web.repository.page.Zone;
          @@ -74,6 +75,13 @@
                   if (content instanceof WebContent)
                   {
                       Collection<ZoneItem> zoneItems = ((WebContent) content).getReferencingZoneItems();
          +            
          +            // For a shared content, we are mainly interrested in refereces of the initial content!
          +            if (content instanceof SharedContent && ((SharedContent) content).getInitialContent() instanceof WebContent)
          +            {
          +                zoneItems.addAll(((WebContent)((SharedContent) content).getInitialContent()).getReferencingZoneItems());
          +            }
          +            
                       for (ZoneItem zoneItem : zoneItems)
                       {
                           Zone zone = zoneItem.getZone();
          

          Raphaël Franchet added a comment - Here is a patch to test Index: main/plugin-web/src/org/ametys/web/content/ContentPagesGenerator.java =================================================================== --- main/plugin-web/src/org/ametys/web/content/ContentPagesGenerator.java (revision 31506) +++ main/plugin-web/src/org/ametys/web/content/ContentPagesGenerator.java (working copy) @@ -33,6 +33,7 @@ import org.ametys.plugins.repository.AmetysObjectResolver; import org.ametys.plugins.repository.AmetysRepositoryException; import org.ametys.plugins.repository.version.VersionableAmetysObject; + import org.ametys.web.repository.content.SharedContent; import org.ametys.web.repository.content.WebContent; import org.ametys.web.repository.page.Page; import org.ametys.web.repository.page.Zone; @@ -74,6 +75,13 @@ if (content instanceof WebContent) { Collection<ZoneItem> zoneItems = ((WebContent) content).getReferencingZoneItems(); + + // For a shared content, we are mainly interrested in refereces of the initial content! + if (content instanceof SharedContent && ((SharedContent) content).getInitialContent() instanceof WebContent) + { + zoneItems.addAll(((WebContent)((SharedContent) content).getInitialContent()).getReferencingZoneItems()); + } + for (ZoneItem zoneItem : zoneItems) { Zone zone = zoneItem.getZone();

            Unassigned Unassigned
            ogehin Olivier Gehin
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: