Details

    • Type: Sub-task Sub-task
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.0
    • Fix Version/s: 2.0
    • Component/s: Themes
    • Labels:
      None
    • Affected Branches:
      MOODLE_20_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE
    • Rank:
      35823

      Description

      xhtml_container_stack::__desctruct() is called during normal shutdown sequence, it is called when somebody just forgets to call $OUTPUT->footer() but it fails when exception is thrown in the output lib, it also fails badly in CLI scripts if you somehow get xhtml_container_stack instantiated.

      I do not think that the single case of missing print_footer() is worth the potential problems. The opencontainers method itself is not reliable because it can not fix general open html tags. The opencontainers is itself very ugly hack we developed because people often abused print_error(). It helps with coding problems too, but I think it would be enough to do the test in regular print_footer()

      If we really want this feature we have to use some defines (globals would not work) to indicate that the page is not HTML or that the bootstrap_renderer already printed error. We would also have to make sure that the $this->opencontainers actually has valid value - I doubt it is possible due to the fact that it may be incremented long before the containers html is actually printed to output

        Activity

        Hide
        Tim Hunt added a comment -

        Fair enough on the whole.

        The one important thing that container_stack does is to let you use templates for methods like print_box, print_box_start and print_box_end. That is, to do start and end, you have to call the box template in start, split it and push the end onto a stack or something, and in end pull the end off the stack.

        Again, we have to make sure it is possible to write a template renderer in future, even if we do not do one now.

        Show
        Tim Hunt added a comment - Fair enough on the whole. The one important thing that container_stack does is to let you use templates for methods like print_box, print_box_start and print_box_end. That is, to do start and end, you have to call the box template in start, split it and push the end onto a stack or something, and in end pull the end off the stack. Again, we have to make sure it is possible to write a template renderer in future, even if we do not do one now.
        Hide
        Petr Škoda added a comment -

        __destruct removed, thanks

        Show
        Petr Škoda added a comment - __destruct removed, thanks

          People

          • Assignee:
            Petr Škoda
            Reporter:
            Petr Škoda
            Tester:
            Nobody
            Participants:
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: