Uploaded image for project: 'phpBB3'
  1. phpBB3
  2. PHPBB3-11777

Extension template events are not loaded from subdirectories

    Details

    • Type: Bug
    • Status: Unverified Fix
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 3.1.0-dev
    • Fix Version/s: 3.1.0-a1
    • Component/s: Template Engine
    • Labels:
      None

      Description

      In writing template event listeners for extensions so far, it has been the habit to place the files in the styles/[style]/template/events/ directory. Since the switch to twig as a template engine, however, template event listeners placed in this directory do not work anymore. They have to be placed directly in styles/[style]/template/.

      Now, the old template engine searched all subdirectories recursively for template event files. This is probably not needed; in order to match the behavior of php event listeners, just searching styles/[style]/template/event/ for files ending in _listener.html is enough. I therefore propose to add 'event/' to the template event listener search path so it will only scan that subdirectory, and a '_listener' suffix to the location to pick up files in the same manner as with php event listeners.

        Activity

        Hide
        VSE Matt Friedman added a comment - - edited

        This has not been the habit: styles/[style]/template/events/

        Template events go in your extensions: styles/[style]/template/

        This works. It has not been broken by TWIG.

        Place template events in the correct location, as per coding guidelines (https://wiki.phpbb.com/Add_Template_Listeners) and they work.

        ext/extname/styles/stylename/template/overall_header_head.html

        This is NOT a bug, and should not be implemented.

        Show
        VSE Matt Friedman added a comment - - edited This has not been the habit: styles/ [style] /template/events/ Template events go in your extensions: styles/ [style] /template/ This works. It has not been broken by TWIG. Place template events in the correct location, as per coding guidelines ( https://wiki.phpbb.com/Add_Template_Listeners ) and they work. ext/extname/styles/stylename/template/overall_header_head.html This is NOT a bug, and should not be implemented.
        Hide
        nickvergessen Joas Schilling added a comment -

        The wiki will be fixed with this merge.

        Anything was allowed previous to the twig patch.

        And we should use a subdir for events to avoid tones of files in the root of the template file...

        Show
        nickvergessen Joas Schilling added a comment - The wiki will be fixed with this merge. Anything was allowed previous to the twig patch. And we should use a subdir for events to avoid tones of files in the root of the template file...

          People

          • Assignee:
            nickvergessen Joas Schilling
            Reporter:
            rechosen rechosen [X] (Inactive)
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development