Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-29959

Token not found exception in ContentViewBuilder when used to build own exception page

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Medium
    • 1.7.9, 1.13.5, 2.3.3, 2.4.1
    • 1.7.8, 1.13.4, 2.2.3, 2.3.2
    • Permissions
    • None

    Description

      The issue happens in all cases when Symfony's Security Component has not been initialised yet, for instance, when any router throws exception.

      Steps to reproduce

      1. Create own ExceptionController
      2. Configure Twig to use custom ExceptionController
        config.yml
        twig:
            exception_controller: App\Controller\ExceptionController::showException
        
      3. In the custom controller try to render template. In template try to do:
         {{ render(controller('ez_content:viewLocation', {
        	'locationId': locationId,
        	'viewType': 'embed'
        })) }}
        

        where locationId is some existing location.

      4. You should see 500 error and exception like Token not found in token storage....

      Solution
      As discussed with bertrand.dunogier@ez.no and andre.romcke@ez.no, ContentViewBuilder should use our PermissionResolver instead of Symfony's AuthorizationChecker.

      Attachments

        Activity

          People

            Unassigned Unassigned
            kamil.madejski@ibexa.co Kamil Madejski
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: