Moodle
  1. Moodle
  2. MDL-28150

Should all plugins, not just mods, have a callback to propose page-type patterns

    Details

    • Type: Improvement Improvement
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 2.1
    • Fix Version/s: DEV backlog, FRONTEND
    • Component/s: Blocks
    • Labels:
    • Affected Branches:
      MOODLE_21_STABLE
    • Rank:
      17768

      Description

      This follows on from MDL-27829

      There is now a callback for mods to generate the list of "Display on page types" choices when editing a block. This should probably be extended to all plugins that can have pages that have blocks on them.

        Issue Links

          Activity

          Hide
          Tim Hunt added a comment -

          Adding watchers, and triaging.

          Show
          Tim Hunt added a comment - Adding watchers, and triaging.
          Hide
          Eloy Lafuente (stronk7) added a comment -

          Uhm, well, I think the callback is available for all plugins and components already (and implemented in a bunch of them, with fallback to default_page_type_list).

          The key is that right now, add_block_at_end_of_default_region() is using simple pagetype as default pagepattern and that leads a lot of times to wrong (non-supporter) patterns in DB.

          So the proposal, that was applied by 67a60db9e76c132a2af0 @ MDL-27829 exclusively to mod-xxx-* pages, is about to guarantee that the pagepattern to be inserted when one block is created is always a supported one (by looking to the available patterns).

          And do that to all the blocks created, at any page. So generate_page_type_patterns() will be called always and, if the simple pagetype is not a supported one, the system will get the first available pagepattern as default one.

          for example, right now, creation of blocks is leading to the insertion of "wrong" pageppaterns in DB (course-report) and that leads one (translated) warning when editing the block about the pattern being changed because the existing one is not available anymore. With the proposal working, the insert will guarantee that the created record already has one valid (supported) pagepattern. So the warning won't be shown.

          That's all. Note this is tidily related with 28149 and depending of that, this will need some change and vice-versa.

          Ciao

          Show
          Eloy Lafuente (stronk7) added a comment - Uhm, well, I think the callback is available for all plugins and components already (and implemented in a bunch of them, with fallback to default_page_type_list). The key is that right now, add_block_at_end_of_default_region() is using simple pagetype as default pagepattern and that leads a lot of times to wrong (non-supporter) patterns in DB. So the proposal, that was applied by 67a60db9e76c132a2af0 @ MDL-27829 exclusively to mod-xxx-* pages, is about to guarantee that the pagepattern to be inserted when one block is created is always a supported one (by looking to the available patterns). And do that to all the blocks created, at any page. So generate_page_type_patterns() will be called always and, if the simple pagetype is not a supported one, the system will get the first available pagepattern as default one. for example, right now, creation of blocks is leading to the insertion of "wrong" pageppaterns in DB (course-report) and that leads one (translated) warning when editing the block about the pattern being changed because the existing one is not available anymore. With the proposal working, the insert will guarantee that the created record already has one valid (supported) pagepattern. So the warning won't be shown. That's all. Note this is tidily related with 28149 and depending of that, this will need some change and vice-versa. Ciao
          Hide
          Helen Foster added a comment -

          Just noting that 'The previously specified page type is no longer selectable. Please choose the most appropriate page type below.' is displayed when adding a new block to Features demo > Reports e.g. http://qa.moodle.net/course/report.php?id=2

          Show
          Helen Foster added a comment - Just noting that 'The previously specified page type is no longer selectable. Please choose the most appropriate page type below.' is displayed when adding a new block to Features demo > Reports e.g. http://qa.moodle.net/course/report.php?id=2
          Hide
          Eloy Lafuente (stronk7) added a comment - - edited

          Raising to blocker. As followup of MDL-27829 we need to address this and sister MDL-28149 ASAP.

          Show
          Eloy Lafuente (stronk7) added a comment - - edited Raising to blocker. As followup of MDL-27829 we need to address this and sister MDL-28149 ASAP.
          Hide
          Frédéric Massart added a comment -

          Where are we at regarding this issue? Things might have slightly changed this then.
          I've also found MDL-30574 which could have a link with this issue, or with MDL-28149.

          Show
          Frédéric Massart added a comment - Where are we at regarding this issue? Things might have slightly changed this then. I've also found MDL-30574 which could have a link with this issue, or with MDL-28149 .
          Hide
          Michael de Raadt added a comment -

          While this may be desirable, I don't think it should block the release.

          Show
          Michael de Raadt added a comment - While this may be desirable, I don't think it should block the release.

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated: