gjb2048 / moodle-theme_essential

The Essential Moodle Theme
https://gjb2048.github.io/moodle-theme_essential/
GNU General Public License v3.0
91 stars 120 forks source link

Editing button in header not working in "modedit" pages #789

Closed jrm-unamur closed 7 years ago

jrm-unamur commented 7 years ago

Moodle version : 3.1 (latest weekly release) Essential version: 2016061711 ('3.1.1.2 (Build: 2016061711)')

When editing an activity (modedit.php page) the editing button added to the header (btw awesome functionality ;-) ) doesn't toggle edition mode. Url associated to the button is missing a "return" param Possible fix : replace 'default' case in switch statement at line 1258 in output/core_renderer.php default: $course = $this->page->course; if ($this->page->url->compare(new moodle_url('/course/view.php'), URL_MATCH_BASE)) { // We are on the course page, retain the current page params e.g. section. $url = clone($this->page->url); } else { // Edit on the main course page. $url = new moodle_url('/course/view.php', array('id'=>$course->id, 'return'=>$this->page->url->out_as_local_url(false))); } if ($this->page->user_is_editing()) { $url->param('edit', 'off'); } else { $url->param('edit', 'on'); } break; Kind regards Jean-Roch Meurisse

gjb2048 commented 7 years ago

Hi Jean-Roch,

Yes there was a bug but the fix was much less complicated than suggested.

Cheers,

Gareth