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.
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.