Edgewall Software
Modify

Opened 7 months ago

Closed 6 months ago

Last modified 6 months ago

#13621 closed defect (fixed)

"TypeError: $(...).autoSubmit is not a function" is raised when no workflow actions defined

Reported by: Jun Omae Owned by: Jun Omae
Priority: normal Milestone: 1.6.1
Component: ticket system Version: 1.6
Severity: normal Keywords:
Cc: Branch:
Release Notes:

Fixed JavaScript error raised from ticket view when no workflow actions defined.

API Changes:
Internal Changes:

Description

This JavaScript error is caused by auto_preview.js not added when no workflow actions defined. The behavior is introduced in [16243] (#12642 1.3.3dev).

12:12:02.242 Uncaught TypeError: $(...).autoSubmit is not a function
    <anonymous> http://localhost/tracenv/newticket:84
    jQuery 13

Patch:

  • trac/ticket/templates/ticket.html

    diff --git a/trac/ticket/templates/ticket.html b/trac/ticket/templates/ticket.html
    index 064e5fc2b..f5fbeaf02 100644
    a b  
    7979        var comment_focused = false;
    8080        $("#comment").focus(function() { comment_focused = true; })
    8181                     .blur(function() { comment_focused = false; });
     82      #   if not disable_submit:
    8283        $("#propertyform").autoSubmit({preview: '1'}, function(data, reply) {
    8384          var items = $(reply);
    8485          // Update ticket box
     
    113114            .next("div.comment").html(reply);
    114115          comment.toggle(comment.children().length != 0);
    115116        }, "#changelog .trac-loading");
     117      #   endif
    116118
    117119      # else:
     120      #   if not disable_submit:
    118121        $("#propertyform").autoSubmit({preview: '1'}, function(data, reply) {
    119122          $('#ticket').replaceWith(reply);
    120123        }, "#ticket .trac-loading");
     124      #   endif
    121125      # endif
    122126      });
    123127    </script>

Attachments (0)

Change History (4)

comment:1 by Dirk Stöcker, 7 months ago

The second part should be "# elif not disable_submit" instead of

# else:
# if
...
# endif
# endif
Last edited 7 months ago by Dirk Stöcker (previous) (diff)

in reply to:  1 comment:2 by Jun Omae, 6 months ago

Replying to Dirk Stöcker:

The second part should be "# elif not disable_submit" instead of

Thanks. That makes sense.

comment:3 by Jun Omae, 6 months ago

Release Notes: modified (diff)
Resolution: fixed
Status: newclosed

Fixed in [17753] and merged in [17754].

comment:4 by Jun Omae, 6 months ago

Owner: set to Jun Omae

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Jun Omae.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Jun Omae to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.