Giter Club home page Giter Club logo

Comments (14)

haivala avatar haivala commented on July 18, 2024 1

Everything is working except in dev the debug web_profiler route is not.
like _profiler/d90e37

from sonatapagebundle.

GeraudBourdin avatar GeraudBourdin commented on July 18, 2024

Do we need siteRequest in subrequest process?

easy fix would be :
Sonata\PageBundle\Site\HostPathByLocaleSiteSelector:28

    if($event->getRequestType() !== HttpKernelInterface::MAIN_REQUEST){
        return;
    }

from sonatapagebundle.

eerison avatar eerison commented on July 18, 2024

SonataPagePathRuntime

why is it related with sub request 🤔 ?

from sonatapagebundle.

eerison avatar eerison commented on July 18, 2024

as requested in #1727

your composer.json extra config (and what appear when you run composer dump-autoload)
index.php file
sonata_page.yaml config
  "extra": {
    "symfony-assets-install": "copy",
    "runtime": {
      "class": "Sonata\\PageBundle\\Runtime\\SonataPagePathRuntime"
    },
    "symfony": {
      "allow-contrib": true
    }
  }

index.php

<?php

use App\Kernel;

require_once dirname(__DIR__).'/vendor/autoload_runtime.php';

return function (array $context) {
    return new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);
};

sonata_page

sonata_page:
  multisite: host_with_path_by_locale
  use_streamed_response: true
  hide_disabled_blocks: true
  page_defaults:
    decorate: true
  skip_redirection: true
  router_auto_register:
    enabled: true
    priority: 200
  ignore_route_patterns:
    - ^(.*)admin(.*) # ignore admin route, ie route containing 'admin'
    - ^_(.*) # ignore symfony routes
  ignore_routes:
    - sonata_page_esi_cache
    - sonata_page_ssi_cache
    - sonata_page_js_sync_cache
    - sonata_page_js_async_cache
    - sonata_cache_apc
    - sonata_cache_esi
...
  ignore_uri_patterns:
    - ^/admin\/
    - ^/api\/
    - ^/stripe\/

  default_template: default
  templates:
    onecolumn:
...
  direct_publication: "%kernel.debug%"
# composer.phar dump-autoload                                                              
Generating autoload files
Generated autoload files

I couldn't reproduce this issue, for me it is working using host_with_path_by_locale and runtime 🤔

@haivala any url is working for you or just some specific ones?

from sonatapagebundle.

GeraudBourdin avatar GeraudBourdin commented on July 18, 2024

i got the error on a fresh new install. I fact this is the first time i see this as it was workging before on my side.

from sonatapagebundle.

eerison avatar eerison commented on July 18, 2024

Everything is working except in dev the debug web_profiler route is not. like _profiler/d90e37

cool I could reproduce the issue ;)

from sonatapagebundle.

eerison avatar eerison commented on July 18, 2024

interesting .... RequestFactory doesn't check ignore routers but it works 😄

from sonatapagebundle.

haivala avatar haivala commented on July 18, 2024

There is these in the logs. looks like double check:
Router Sonata\PageBundle\Route\CmsPageRouter was unable to generate route. Reason: 'Route 'Route '_profiler' not found' not found': The Sonata CmsPageRouter cannot find url

I used this code to access the profiler: #1738 (comment)

from sonatapagebundle.

eerison avatar eerison commented on July 18, 2024

There is these in the logs. looks like double check: Router Sonata\PageBundle\Route\CmsPageRouter was unable to generate route. Reason: 'Route 'Route '_profiler' not found' not found': The Sonata CmsPageRouter cannot find url

I used this code to access the profiler: #1738 (comment)

I saw that there is a pice of code doing a similar check 🤔

public function isDecorable(Request $request, int $requestType, Response $response): bool

from sonatapagebundle.

GeraudBourdin avatar GeraudBourdin commented on July 18, 2024

Sorry i had work to do. Imho the main problem is in /Data/Projets/SonataExtra/SonataExtra/vendor/symfony/http-kernel/Fragment/InlineFragmentRenderer.php:116

Request is passed, but is recreated ? i don't understand how this could have worked before.

from sonatapagebundle.

GeraudBourdin avatar GeraudBourdin commented on July 18, 2024

it appears that using RequestFactory fix the issue.

For example using :
return new HttpKernelRunner($application, RequestFactory::createFromGlobals('host_with_path_by_locale'));
in the runtime as the initial MR fix the problem.

I think we should revert this change and go back to the extra param ;(
I do not know how users could use fragments as i ve nevers used this, but in that case, it should contains siteRequestInterface no ?

from sonatapagebundle.

GeraudBourdin avatar GeraudBourdin commented on July 18, 2024

@eerison could you try this on your side?

from sonatapagebundle.

eerison avatar eerison commented on July 18, 2024

n the runtime as the initial MR fix the problem.

I do not know how users could use fragments as i ve nevers used this,

when someone face this issue, they gonna open a issue and we gonna understand how it works.

from sonatapagebundle.

GeraudBourdin avatar GeraudBourdin commented on July 18, 2024

i think we should go back to the RequestFactory::createFromGlobals in the runtime. So, nobody will have to open any issue on this subject ^^

from sonatapagebundle.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.