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

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Medium Medium
    • Resolution: Fixed
    • Affects Version/s: 1.7.8, 1.13.4, 2.2.3, 2.3.2
    • Fix Version/s: 1.7.9, 1.13.5, 2.3.3, 2.4.1
    • Component/s: Permissions
    • Labels:
      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 and André Rømcke, ContentViewBuilder should use our PermissionResolver instead of Symfony's AuthorizationChecker.

        Activity

          People

          • Assignee:
            Unassigned
            Reporter:
            Kamil Madejski
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: