Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-70855

Implement a way to hook into definition_after_data of activity forms

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide
      1. Install https://github.com/dmitriim/moodle-local_helper to local/helper

        git clone git@github.com:dmitriim/moodle-local_helper.git local/helper

      2. Create a course 
      3. Create a page activity in the course with any name (except "Page 1").
      4. Edit the page activity and make sure you don't see text "The callback coursemodule_definition_after_data works!" above the Name field.
      5. Rename activity to "Page 1" and save.
      6. Edit the page activity again and make sure you see text "The callback coursemodule_definition_after_data works!" above the Name field.
         
      Show
      Install https://github.com/dmitriim/moodle-local_helper  to local/helper git clone git@github.com:dmitriim/moodle-local_helper.git local/helper Create a course  Create a page activity in the course with any name (except "Page 1"). Edit the page activity and make sure you don't see text "The callback coursemodule_definition_after_data works!" above the Name field. Rename activity to "Page 1" and save. Edit the page activity again and make sure you see text "The callback coursemodule_definition_after_data works!" above the Name field.  
    • Affected Branches:
      MOODLE_311_STABLE
    • Fixed Branches:
      MOODLE_311_STABLE
    • Pull from Repository:
    • Pull 3.11 Branch:
      MDL-70855-MOODLE_311_STABLE
    • Pull Master Branch:
      MDL-70855-master

      Description

      There are a couple of useful callbacks for extending mod forms like coursemodule_edit_post_actions, coursemodule_standard_elements and coursemodule_validation. However at some point definition_after_data can change the form for some activities. 

      Would be good to add one more callback to be able to let the plugins to extend the form after the data as set.

        Attachments

          Activity

            People

            Assignee:
            dmitriim Dmitrii Metelkin
            Reporter:
            dmitriim Dmitrii Metelkin
            Peer reviewer:
            Brendan Heywood Brendan Heywood
            Integrator:
            Sara Arjona (@sarjona) Sara Arjona (@sarjona)
            Tester:
            Janelle Barcega Janelle Barcega
            Participants:
            Component watchers:
            Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Sara Arjona (@sarjona)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              17/May/21

                Time Tracking

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 30 minutes
                30m