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

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

    Details

    • Type: Bug
    • Status: Closed
    • Priority: 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

      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.

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            marina 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 Marina Glancy added a comment - Hi Kirill, thanks for reporting that. Should be a one-line patch in lib/form/editor.php really.
            Hide
            badblock Kirill Astashov added a comment -

            Yep, the patch is small.
            Attaching now.

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

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

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

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

            Thanks again for working on this.

            Show
            marina Marina Glancy added a comment - actually never mind, I created all the branches in my github. Thanks again for working on this.
            Hide
            poltawski 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
            poltawski 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
            poltawski 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
            poltawski 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 Marina Glancy added a comment -

            done

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

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

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

            works as expected!
            Passing
            Thanks

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

            Fixed STOP Closed STOP Thanks STOP

            Yay, imagination! Ciao

            Show
            stronk7 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:
                  Fix Release Date:
                  10/Sep/12