catalyst / moodle-block_multiblock

Moodle plugin which allows you to embed multiple blocks within a single block region using different formats including tabs and accordions
GNU General Public License v3.0
12 stars 12 forks source link

Return correct URL when block is on Workplace custom page #102

Closed Limekiller closed 1 year ago

Limekiller commented 1 year ago

Currently, this plugin doesn't work correctly when included in a custom page, a feature of Moodle Workplace. When using the get_page_url method to determine the URL that the block is located on, a URL with the path /admin/tool/custompage.php is returned. This location doesn't exist, meaning that when clicking on the "Block location" crumb in the breadcrumb navigation, or when clicking "Save and display" after editing a sub-block, we are greeted with a 404 error. This pull request simply checks if the block is on a custom page and ensures that the correct URL is returned.

danmarsden commented 1 year ago

Thanks Bryce!