Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#15160 closed defect (fixed)

invalid plugin name interferes with loading other plugins

Reported by: Jovanovic Owned by: Jared Jurkiewicz
Priority: low Milestone: 1.8
Component: Editor Version: 1.7.2
Keywords: Cc:
Blocked By: Blocking:

Description

Hello,

I discovered a little bug with dijit/_editor/plugins/ViewSource plugin : if i declare a plugin that it isn't required, when i click on viewsource button, source code of the editor isn't rendered.

<!DOCTYPE html>
<html >
<head>
<script src="http://ajax.googleapis.com/ajax/libs/dojo/1.7.2/dojo/dojo.js" data-dojo-config="parseOnLoad: true, async: true, isDebug: true"></script>
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/dojo/1.7.2/dijit/themes/claro/claro.css">
<script>require(["dojo/parser","dijit/Editor","dijit/_editor/plugins/ViewSource"]);</script>
</head>
<body class="claro">
<div data-dojo-type="dijit.Editor" id="editor1" data-dojo-props="plugins:['cut','copy','paste','toto','viewsource','AutoUrlLink']">
    <p>This instance is created with a subset of functions enabled in the order we want</p>
</div>
</body>
</html>

Attachments (2)

viewsource.html (669 bytes) - added by Jovanovic 7 years ago.
15160.patch (1.6 KB) - added by Jared Jurkiewicz 7 years ago.
Patch for this issue. Improved message when plugin fails to load (it reports the name in the error). Also added small check in the ViewSource? plugin to verify that an object passed in is actually an extension of _Plugin.

Download all attachments as: .zip

Change History (6)

Changed 7 years ago by Jovanovic

Attachment: viewsource.html added

comment:1 Changed 7 years ago by bill

Component: DijitEditor
Priority: undecidedlow
Summary: bug with dijit.editor viewsource plugininvalid plugin name interferes with loading other plugins

Generally, dijit isn't expected to complete initialization when it hits an error, but I'll take a look anyway. It is printing a "Cannot find plugin toto" error message to the console.

Changed 7 years ago by Jared Jurkiewicz

Attachment: 15160.patch added

Patch for this issue. Improved message when plugin fails to load (it reports the name in the error). Also added small check in the ViewSource? plugin to verify that an object passed in is actually an extension of _Plugin.

comment:2 Changed 7 years ago by bill

Milestone: tbd1.8
Owner: set to Jared Jurkiewicz
Status: newassigned

This seems good to me, go ahead and check this in (but the cutoff is today's meeting).

comment:3 Changed 7 years ago by Jared Jurkiewicz

Resolution: fixed
Status: assignedclosed

In [29308]:

Improve error message about missing plugin, plus make ViewSource? checking a bit more robust. fixes #15160

Last edited 7 years ago by Jared Jurkiewicz (previous) (diff)

comment:4 Changed 7 years ago by Jared Jurkiewicz

Ignore the '[IGNORE:RALLY,COPYRIGHT]' That's a message I am required to use every day at my job for commits to SVN, so I 'auto-type' it if I don't force myself not to. It has no relation to the code/copyright of dojo. Sorry about that.

Note: See TracTickets for help on using tickets.