Code Block Macro cannot be collapsed or expanded

XMLWordPrintable

    • 3
    • Severity 3 - Minor
    • 6

      Issue Summary

      With Confluence DC 9.5.1, the Collapsible feature of the Code Block Macro no longer functions as expected. This impacts existing pages, as well as new pages. On the impacted version, the Code Block is always initially rendered in Expanded view and can't be Collapsed. 

      Steps to Reproduce

      1. Create a new page
      2. On the page, insert the Code Block Macro
      3. Click Edit on the Code Block » tick Collapsible » Save » publish page

      Sample Storage Format

      <p>123</p>
      <p><br /></p><ac:structured-macro ac:name="code" ac:schema-version="1" ac:macro-id="3d88c72d-fa16-470e-8c68-4e0a84e06243"><ac:parameter ac:name="collapse">true</ac:parameter><ac:plain-text-body><![CDATA[test123
      1
      2
      3]]></ac:plain-text-body></ac:structured-macro>
      <p><br /></p>
      <p><br /></p>
      <p><br /></p>
      

      Expected Results

      The Code Block is rendered initially in collapsed view and clicking "Expand Source" should expand the Code Block.

      Actual Results

      The Code Block is rendered initially in expanded view and clicking "Expand Source" and "Collapse Source" has no impact.

      The below WARN exception is thrown in the atlassian-confluence.log file:

      2025-06-23 15:49:49,430 WARN [http-nio-8090-exec-8] [cache.filecache.impl.OneStreamCache] tryStreamCallback Problem caching to disk, skipping cache for this entry
       -- url: /s/d41d8cd98f00b204e9800998ecf8427e-CDN/-lkowe5/9203/1jny37e/33ef151b8630c5bb23ef774c5af203bd/_/download/contextbatch/css/baseurl-checker-resource,atl.general,viewcontent,main,page,atl.confluence.plugins.pagetree-desktop,atl.comments,zdu-banner-all,-_super/batch.css | userName: admin | referer: http://localhost:8090/spaces/LOU/pages/360461/code+block+test | traceId: 251aa55a39820f82
      java.lang.RuntimeException: Cannot read resource sh/styles/collapseSource.css
      	at com.atlassian.plugin.webresource.impl.snapshot.resource.strategy.contentprovider.StreamContentProviderStrategy$1.writeTo(StreamContentProviderStrategy.java:35)
      	at com.atlassian.plugin.webresource.impl.support.factory.InitialSourceContent$1.writeTo(InitialSourceContent.java:40)
      	at com.atlassian.plugin.webresource.impl.helpers.ResourceServingHelpers$8.writeTo(ResourceServingHelpers.java:530)
      	at com.atlassian.plugin.webresource.impl.helpers.ResourceServingHelpers$9.writeTo(ResourceServingHelpers.java:542)
      	at com.atlassian.plugin.webresource.impl.helpers.ResourceServingHelpers$8.writeTo(ResourceServingHelpers.java:530)
      	at com.atlassian.plugin.webresource.impl.helpers.ResourceServingHelpers$4.streamResource(ResourceServingHelpers.java:390)
      	at com.atlassian.plugin.webresource.transformer.TransformerUtils.transformAndStreamResource(TransformerUtils.java:39)
      	at com.atlassian.plugin.webresource.transformer.CharSequenceDownloadableResource.streamResource(CharSequenceDownloadableResource.java:41)
      	at com.atlassian.plugin.webresource.impl.helpers.ResourceServingHelpers$5.writeTo(ResourceServingHelpers.java:409)
      	at com.atlassian.plugin.webresource.impl.helpers.ResourceServingHelpers$9.writeTo(ResourceServingHelpers.java:542)
      	at com.atlassian.plugin.webresource.impl.helpers.ResourceServingHelpers$2.lambda$writeTo$0(ResourceServingHelpers.java:219)
      	at com.atlassian.plugin.cache.filecache.impl.OneStreamCache.streamToCache(OneStreamCache.java:68)
      	at com.atlassian.plugin.cache.filecache.impl.OneStreamCache.lambda$stream$0(OneStreamCache.java:39)
      	at com.atlassian.plugin.cache.filecache.impl.StreamsCache.tryStreamCallback(StreamsCache.java:103)
      	at com.atlassian.plugin.cache.filecache.impl.StreamsCache.doEnter(StreamsCache.java:84)
      	at com.atlassian.plugin.cache.filecache.impl.OneStreamCache.stream(OneStreamCache.java:36)
      	at com.atlassian.plugin.cache.filecache.impl.FileCacheImpl.cache(FileCacheImpl.java:106)
      	at com.atlassian.plugin.webresource.impl.helpers.ResourceServingHelpers$2.writeTo(ResourceServingHelpers.java:219)
      	at com.atlassian.plugin.webresource.impl.helpers.ResourceServingHelpers$7.writeTo(ResourceServingHelpers.java:435)
      	at com.atlassian.plugin.webresource.impl.helpers.ResourceServingHelpers$1.writeTo(ResourceServingHelpers.java:150)
      	at com.atlassian.plugin.webresource.impl.http.Controller.lambda$sendCachedInProduction$4(Controller.java:540)
      	at com.atlassian.plugin.cache.filecache.impl.OneStreamCache.streamToCache(OneStreamCache.java:68)
      	at com.atlassian.plugin.cache.filecache.impl.OneStreamCache.lambda$stream$0(OneStreamCache.java:39)
      	at com.atlassian.plugin.cache.filecache.impl.StreamsCache.tryStreamCallback(StreamsCache.java:103)
      	at com.atlassian.plugin.cache.filecache.impl.StreamsCache.doEnter(StreamsCache.java:84)
      	at com.atlassian.plugin.cache.filecache.impl.OneStreamCache.stream(OneStreamCache.java:36)
      	at com.atlassian.plugin.cache.filecache.impl.FileCacheImpl.cache(FileCacheImpl.java:106)
      	at com.atlassian.plugin.webresource.impl.http.Controller.sendCachedInProduction(Controller.java:539)
      	at com.atlassian.plugin.webresource.impl.http.Controller.sendCached(Controller.java:445)
      	at com.atlassian.plugin.webresource.impl.http.Controller.serveResources(Controller.java:341)
      	at com.atlassian.plugin.webresource.impl.http.Controller.serveBatch(Controller.java:126)
      	at com.atlassian.plugin.webresource.impl.http.Router$5.apply(Router.java:94)
      	at com.atlassian.plugin.webresource.impl.http.Router$5.apply(Router.java:85)
      	at com.atlassian.plugin.webresource.impl.support.http.BaseRouter.callHandler(BaseRouter.java:248)
      	at com.atlassian.plugin.webresource.impl.support.http.BaseRouter.dispatch(BaseRouter.java:223)
      	at com.atlassian.plugin.webresource.servlet.PluginResourceDownload.serveFile(PluginResourceDownload.java:64)
      	at com.atlassian.plugin.servlet.AbstractFileServerServlet.doGet(AbstractFileServerServlet.java:30)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:529)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:623)
      

      Workaround

      Currently there is no known workaround for this behavior. A workaround will be added here when available

        1. expected-expanded.png
          expected-expanded.png
          69 kB
        2. expected-collapsed.png
          expected-collapsed.png
          96 kB
        3. actual.png
          actual.png
          67 kB

              Assignee:
              Saba Taseer (Inactive)
              Reporter:
              Lou Paglaiccetti
              Votes:
              9 Vote for this issue
              Watchers:
              18 Start watching this issue

                Created:
                Updated:
                Resolved: