Moodle
  1. Moodle
  2. MDL-34669

Legacy course files are not shown in editor filepicker (context issue)

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.2.4, 2.3.1
    • Fix Version/s: 2.2.5, 2.3.2
    • Component/s: Filepicker
    • Labels:
    • Testing Instructions:
      Hide

      1. Enable course files in a course (set legacyfiles to 2 in 'course' table).
      2. Enable Legacy course files repository.
      3. Add come course files via Course admin -> Legacy course files menu.
      4. Go to Add post to a forum in the course.
      5. In TinyMCE filepicker, select Legacy course files to get empty list.

      Show
      1. Enable course files in a course (set legacyfiles to 2 in 'course' table). 2. Enable Legacy course files repository. 3. Add come course files via Course admin -> Legacy course files menu. 4. Go to Add post to a forum in the course. 5. In TinyMCE filepicker, select Legacy course files to get empty list.
    • Workaround:
      Hide

      Patch provided.

      Show
      Patch provided.
    • Affected Branches:
      MOODLE_22_STABLE, MOODLE_23_STABLE
    • Fixed Branches:
      MOODLE_22_STABLE, MOODLE_23_STABLE
    • Pull Master Branch:
      wip-MDL-34669-master
    • Rank:
      43122

      Description

      When called from editor instance on some pages (e.g. adding post to forum),
      filepicker is showing empty list of legacy course files.

      This is happening because context is not set properly for editor which forces
      lib/form/editor.php to fallback to system context.

      I'll provide with patch which changes this behavior to make editor use page context
      instead, and only if it fails, then set context to context_system.

      1. MDL-34669.diff
        1.0 kB
        Kirill Astashov

        Activity

        Hide
        Marina Glancy added a comment -

        Hi Kirill, thanks for reporting that. Should be a one-line patch in lib/form/editor.php really.

        Show
        Marina Glancy added a comment - Hi Kirill, thanks for reporting that. Should be a one-line patch in lib/form/editor.php really.
        Hide
        Kirill Astashov added a comment -

        Yep, the patch is small.
        Attaching now.

        Show
        Kirill Astashov added a comment - Yep, the patch is small. Attaching now.
        Hide
        Marina Glancy added a comment -

        Kirill, can you please push to your master branch in git the current master? Thanks

        Show
        Marina Glancy added a comment - Kirill, can you please push to your master branch in git the current master? Thanks
        Hide
        Marina Glancy added a comment -

        actually never mind, I created all the branches in my github.

        Thanks again for working on this.

        Show
        Marina Glancy added a comment - actually never mind, I created all the branches in my github. Thanks again for working on this.
        Hide
        Dan Poltawski added a comment -

        The main moodle.git repository has just been updated with latest weekly modifications. You may wish to rebase your PULL branches to simplify history and avoid any possible merge conflicts. This would also make integrator's life easier next week.

        TIA and ciao

        Show
        Dan Poltawski added a comment - The main moodle.git repository has just been updated with latest weekly modifications. You may wish to rebase your PULL branches to simplify history and avoid any possible merge conflicts. This would also make integrator's life easier next week. TIA and ciao
        Hide
        Dan Poltawski added a comment -

        Hi Marina,

        Please could you convert from get_context_instance to context_system::instance(), as these have/will have all been removed from master shortly.

        Show
        Dan Poltawski added a comment - Hi Marina, Please could you convert from get_context_instance to context_system::instance(), as these have/will have all been removed from master shortly.
        Hide
        Marina Glancy added a comment -

        done

        Show
        Marina Glancy added a comment - done
        Hide
        Dan Poltawski added a comment -

        Integrated to 22, 23 and master. thanks Kirill & Marina.

        Show
        Dan Poltawski added a comment - Integrated to 22, 23 and master. thanks Kirill & Marina.
        Hide
        Ankit Agarwal added a comment -

        works as expected!
        Passing
        Thanks

        Show
        Ankit Agarwal added a comment - works as expected! Passing Thanks
        Hide
        Eloy Lafuente (stronk7) added a comment -

        Fixed STOP Closed STOP Thanks STOP

        Yay, imagination! Ciao

        Show
        Eloy Lafuente (stronk7) added a comment - Fixed STOP Closed STOP Thanks STOP Yay, imagination! Ciao

          People

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

            Dates

            • Created:
              Updated:
              Resolved: