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

YUI throwing error while adding image from recent files repository

    Details

    • Testing Instructions:
      Hide

      1. Uncheck repositoryallowexternallinks in settings
      2. Open any TinyMCE texteditor and try to insert an image from Server files, make sure it is inserted

      Tester: please replicate specific bug conditions then verify the issue is fixed.

      Show
      1. Uncheck repositoryallowexternallinks in settings 2. Open any TinyMCE texteditor and try to insert an image from Server files, make sure it is inserted Tester: please replicate specific bug conditions then verify the issue is fixed.
    • Affected Branches:
      MOODLE_21_STABLE, MOODLE_22_STABLE, MOODLE_23_STABLE
    • Fixed Branches:
      MOODLE_21_STABLE, MOODLE_22_STABLE
    • Pull Master Branch:
      wip-MDL-32106-master

      Description

      Under certain conditions (unable to determine what exactly), YUI will throw an error, as is described in the forums on:
      http://moodle.org/mod/forum/discuss.php?d=183588

      Basically the /repository/filepicker.js causes an error on the following line:

      var linkexternal = Y.one('#linkexternal-'+client_id).get('checked');
       
      This Y.one('#linkexternal-'+client_id) seems to be null in some cases. This causes the system to freeze.

      Since then, I've been able to create a hack to work around this problem.
      If I hack it to match the following, it does seem to work:

      ...
                          // when image or media button is clicked
                          if ( this.options.return_types != 1 ) {
      //                        var linkexternal = Y.one('#linkexternal-'+client_id).get('checked');
      //                        if (linkexternal) {
      //                            params['linkexternal'] = 'yes';
      //                        }
      //                    } else {
      //                        // when link button in editor clicked
                              params['linkexternal'] = 'yes';
                          }

        Gliffy Diagrams

          Attachments

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  14/May/12