Moodle

Link "Turn editing on/off" in administration block

Details

  • Type: Bug Bug
  • Status: Open Open
  • Priority: Major Major
  • Resolution: Unresolved
  • Affects Version/s: 1.7.3, 1.7.4, 1.8, 1.8.1, 1.8.2, 1.8.3, 1.8.4, 1.8.5, 1.9
  • Fix Version/s: None
  • Component/s: General
  • Labels:
    None
  • Affected Branches:
    MOODLE_17_STABLE, MOODLE_18_STABLE, MOODLE_19_STABLE

Description

When I activate "Show the course blocks" in the resource compose a web page and then I choose "Turn editing off" in Administration block, I obtain the following error "Course Module ID was incorrect".
Perhaps you should change the link because when you are on a resource and not on the course page, the path oh the relative link is wrong.

Issue Links

Activity

Hide
Ann Adamcik added a comment -

The problem here is that the resource page is created with the page_course() subclass (in lib/pagelib.php). This subclass is for creating course pages - it doesn't know anything about resource pages. The created page object contains the course info., but has no id or other info for the resource. There are several problems this causes:

1. This one - incorrect turn editing on/off link in the administration block.
2. If the administration block isn't present, there is no way to turn editing on or off (no edit button elsewhere).
3. The breadcrumb navigation is wrong, and the 'jump to' activity menu is missing - see MDL-10991 and MDL-7288.
4. Adding, deleting, showing, hiding, editing, or moving blocks loads the course page instead of the resource page.

There are 2 possible solutions:

1. Use a subclass of page_generic_activity() to create the page instead of using page_course(). This will make the resource page behave like an activity page (e.g. quiz), with limited blocks, instead of like a course page with all the blocks.

2. Create a new page_resource() subclass that displays all the course blocks, contains information about the resource, and has correct navigation and links, and a "blocks editing" button.

Any thoughts on which approach would be better? I do have a working fix for option 1, and I'm almost there with option 2.

Show
Ann Adamcik added a comment - The problem here is that the resource page is created with the page_course() subclass (in lib/pagelib.php). This subclass is for creating course pages - it doesn't know anything about resource pages. The created page object contains the course info., but has no id or other info for the resource. There are several problems this causes: 1. This one - incorrect turn editing on/off link in the administration block. 2. If the administration block isn't present, there is no way to turn editing on or off (no edit button elsewhere). 3. The breadcrumb navigation is wrong, and the 'jump to' activity menu is missing - see MDL-10991 and MDL-7288. 4. Adding, deleting, showing, hiding, editing, or moving blocks loads the course page instead of the resource page. There are 2 possible solutions: 1. Use a subclass of page_generic_activity() to create the page instead of using page_course(). This will make the resource page behave like an activity page (e.g. quiz), with limited blocks, instead of like a course page with all the blocks. 2. Create a new page_resource() subclass that displays all the course blocks, contains information about the resource, and has correct navigation and links, and a "blocks editing" button. Any thoughts on which approach would be better? I do have a working fix for option 1, and I'm almost there with option 2.
Hide
Wen Hao Chuang added a comment -

Hmm... is this still a problem in the latest 1.9.7+ codes? I just noticed one behavior which might be related and are still searching to see if someone already opened a ticket for this. When you login as a Admin User, if you don't have any blocks enabled, then click on "Turn editing on" button (see Fig01) and add ONE block to the page (ONLY one block, see Fig02), then click on "Turn editing off" button again, then the block that you just added to the page will also got disappeared. Is this the same problem described here or is there another ticket that has been created for this? Just curious, thanks!

Show
Wen Hao Chuang added a comment - Hmm... is this still a problem in the latest 1.9.7+ codes? I just noticed one behavior which might be related and are still searching to see if someone already opened a ticket for this. When you login as a Admin User, if you don't have any blocks enabled, then click on "Turn editing on" button (see Fig01) and add ONE block to the page (ONLY one block, see Fig02), then click on "Turn editing off" button again, then the block that you just added to the page will also got disappeared. Is this the same problem described here or is there another ticket that has been created for this? Just curious, thanks!
Hide
Eduardo Domínguez added a comment -

I presume there are still problems with this setting, we have the calendar in all our courses, whenever we enter to the resource, the calendar seems to loose all activities and when you click on it, it's showing the *Invalid course ID* message. I beleave it's safer if we don't use this feature.

Show
Eduardo Domínguez added a comment - I presume there are still problems with this setting, we have the calendar in all our courses, whenever we enter to the resource, the calendar seems to loose all activities and when you click on it, it's showing the *Invalid course ID* message. I beleave it's safer if we don't use this feature.
Hide
Mark van Hoek added a comment -

I can confirm this is still an issue in 1.9.13+

Show
Mark van Hoek added a comment - I can confirm this is still an issue in 1.9.13+

Dates

  • Created:
    Updated: