Block title links should be made optional
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Mahara |
Fix Released
|
Medium
|
Eugene |
Bug Description
Blocks that contain a single artefact are automatically rendered with a link around the block title pointing to view/artefact.
That is annoying for artefact plugin authors who haven't implemented a render_self function, because that page is broken without one.
There are two things we should do to solve this.
(1) Either
- make render_self abstract in the base class (force plugin authors to write it as it's used in html export anyway); or
- implement a very plain render_self function in the ArtefactType base class to stop view/artefact.php from breaking (personally i prefer this option)
(2) Make the title link to view/artefact.php optional in the render_viewing function in blocktype/lib.php. We could allow blocktypes to say whether to add the link or not, or perhaps control it at the instance config level so that blocktypes can allow the user to decide whether to link the title or not. (We should also allow view owners to turn off the display of the block titles altogether if they want to...)
Changed in mahara: | |
status: | New → Confirmed |
importance: | Undecided → Medium |
Changed in mahara: | |
status: | Fix Committed → Fix Released |
Richard - Please see the patch I'm attaching herewith.
Instead of creating a 'render_self' abstract method or implementing the method in the ArtefactType base class, the patch checks whether the 'render_self' method exists within the relevant artefact class, before creating the link to view.
I have also added a 'Display Title' option that allows for turning on/off the displaying of the title for a relevant block.
Please have a look and let me know if I misunderstood or if anything needs changing ;)