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

linktext option gets lost when the new comments get AJAXd in

XMLWordPrintable

    • MOODLE_401_STABLE, MOODLE_403_STABLE, MOODLE_404_STABLE, MOODLE_405_STABLE
    • MOODLE_403_STABLE, MOODLE_404_STABLE
    • MDL-82309-403
    • MDL-82309-404
    • Hide
      1. Make the following change to mod/data/classes/template.php (around line 690):

        +++ b/mod/data/classes/template.php
        @@ -687,6 +687,7 @@ class template {
                     'itemid' => $entry->id,
                     'showcount' => true,
                     'component' => 'mod_data',
        +            'linktext' => 'MDL-82309',
                 ];
                 $comment = new comment($cmdata);
                 return $comment->output(true);
        

      2. Log in as admin
      3. Create a course
      4. Add a Database activity to course
        • Allow comments on entries: Yes
      5. Use Journal preset
      6. Add an entry to database
      7. View entry
      8. Expand the comment area (press MDL-82309 (0))
      9. Confirm link text shows MDL-82309 (0)
      10. Add a comment
      11. Confirm link text shows MDL-82309 (1)
      12. Add another comment
      13. Confirm link text shows MDL-82309 (2)
      14. Delete first comment
      15. Confirm link text shows MDL-82309 (1)
      16. Delete last comment
      17. Confirm link text shows MDL-82309 (0)
      Show
      Make the following change to mod/data/classes/template.php (around line 690): +++ b/mod/data/classes/template.php @@ -687,6 +687,7 @@ class template { 'itemid' => $entry->id, 'showcount' => true, 'component' => 'mod_data', + 'linktext' => 'MDL-82309', ]; $comment = new comment($cmdata); return $comment->output(true); Log in as admin Create a course Add a Database activity to course Allow comments on entries: Yes Use Journal preset Add an entry to database View entry Expand the comment area (press MDL-82309 (0) ) Confirm link text shows MDL-82309 (0) Add a comment Confirm link text shows MDL-82309 (1) Add another comment Confirm link text shows MDL-82309 (2) Delete first comment Confirm link text shows MDL-82309 (1) Delete last comment Confirm link text shows MDL-82309 (0)

      The comments API lets you specify a linktext option in the options parameter of the comments constructor. It works, but the moment the user clicks to save a comment and the area of the page gets re-drawn it goes back to the default.

            pholden Paul Holden
            andrew_dc_hancox Andrew Hancox
            Laurent David Laurent David
            Andrew Lyons Andrew Lyons
            Kim Jared Lucas Kim Jared Lucas
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 57 minutes
                57m

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.