Use request directly instead of handling a full request

Created on 7 March 2024, about 1 year ago
Updated 8 March 2024, about 1 year ago

The field ComputedBreadcrumbsItemList handles a second Request on line 49. This may lead to errors if the calculated field is called on Kernel destruct, because the session header has already been sent back to the client. Happens in several potential cases, e.g. Search API index immediately.

Would it be possible to create a route match directly from the Request created instead of going through a controller call?

🐛 Bug report
Status

Active

Version

1.1

Component

Code

Created by

🇨🇭Switzerland Siegrist

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @Siegrist
  • 🇨🇭Switzerland Siegrist

    Siegrist changed the visibility of the branch 3426428-use-request-directly to hidden.

  • Pipeline finished with Failed
    about 1 year ago
    Total: 290s
    #114439
  • Pipeline finished with Failed
    about 1 year ago
    Total: 198s
    #114808
  • Pipeline finished with Success
    about 1 year ago
    Total: 286s
    #114970
  • 🇨🇭Switzerland Siegrist

    Ok, this solution passes the test. Removing the unused code.

  • Pipeline finished with Success
    about 1 year ago
    Total: 201s
    #114976
  • 🇨🇭Switzerland Siegrist

    I hope I haven't deleted any functionality. Would be nice to get this committed. Thanks

  • 🇬🇧United Kingdom Eli-T Manchester

    Updating target version to 1.2.x as the current supported branch.

  • Status changed to Needs work 8 months ago
  • 🇬🇧United Kingdom Eli-T Manchester

    This looks like it conflicts with the 1.2.x branch.

  • Merge request !193426428 v2 → (Open) created by Eli-T
  • 🇬🇧United Kingdom Eli-T Manchester

    I think this change is a really good idea.
    The original MR 13 was done on the 1.1.x branch rather than an issue specific branch, so I've copied that modified 1.1.x branch to 3426428_v2 branch, merged in the 1.2.x branch and fixed the merge conflicts.

    It looks like we do now have test failures to address before we can proceed.

  • 🇬🇧United Kingdom Eli-T Manchester
  • 🇬🇧United Kingdom Eli-T Manchester

    There are two issues with this proposal at the moment.

    1) it doesn't take account of the use_relative_urls configuration setting for the module
    2) it breaks when viewing the content through JSON:API; that is the breadcrumbs refer to the JSON:API path

    1) is not surprising as the initial work on this issue was done before that option was merged.

    However, 2) is more of a fundamental problem with this approach - this is a breaking change, and it is difficult to see how this would ever be the wanted behaviour when viewing content through JSON:API.

    For example - here is the jsonapi output on the main branch for an example page using absolute links

    breadcrumbs	
      0	
        uri	"https://recommended-project.ddev.site/"
        title	"Home"
        options	[]

    With this change it looks like this

    breadcrumbs	
      0	
        uri	"https://recommended-project.ddev.site/"
        title	"Home"
        options	[]
      1	
        uri	"https://recommended-project.ddev.site/jsonapi"
        title	"Jsonapi"
        options	[]
Production build 0.71.5 2024