Skip to content

block get_content() is called twice on page load. #4

@danmarsden

Description

@danmarsden

the get_content() function of a block is always called twice on a page load - for that reason we populate $this->content on the first call and then check it at the top and return the content if it isn't null - for an example see:
https://github.com/moodle/moodle/blob/master/blocks/html/block_html.php#L56

Please adjust your get_content function so that it performs a similar check and doesn't run the same set of functions/queries twice on the page load.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions