Edgewall Software

Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#12591 closed enhancement (fixed)

Implement IRequestFilter in BatchModifyModule for adding template data to query request

Reported by: Ryan J Ollos Owned by: Ryan J Ollos
Priority: normal Milestone: 1.0.14
Component: ticket system Version:
Severity: normal Keywords: batch-modify
Cc: Branch:
Release Notes:

BatchModifyModule implements IRequestFilter to add template data for a request to path /query.

API Changes:
Internal Changes:


Implementing IRequestFilter in batch.py would avoid the need to import BatchModifyModule in query.py and check if the component is enabled.

First discussed in comment:58:ticket:11901.

Attachments (0)

Change History (5)

comment:1 by Ryan J Ollos, 6 years ago

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

Committed to 1.0-stable in r15154, merged to trunk in r15155, merged to trunk in r15156.

comment:2 by Ryan J Ollos, 6 years ago

A related proposed change:

  • trac/ticket/templates/batch_modify.html

    commit b80641289a98d1ab8e58e715cfc772119ebcf237
    Author: Ryan J Ollos <ryan.j.ollos@gmail.com>
    Date:   Sat Sep 17 18:36:59 2016 -0700
        Move batch initialize
    diff --git a/trac/ticket/templates/batch_modify.html b/trac/ticket/templates/batch_modify.html
    index be5ada2..5819ccd 100644
    a b  
    1414     xmlns:xi="http://www.w3.org/2001/XInclude"
    1515     id="batchmod_form" method="post" action="${req.href + '/batchmodify'}">
     17<script type="text/javascript">
     18  jQuery(document).ready(function($) {
     19    initializeBatch();
     20  });
    1723<fieldset id="batchmod_fieldset">
    1824  <legend class="foldable">Batch Modify</legend>
    1925  <table summary="Batch modification fields">
  • trac/ticket/templates/query.html

    diff --git a/trac/ticket/templates/query.html b/trac/ticket/templates/query.html
    index b6e9830..cd33b44 100644
    a b  
    2222    <script type="text/javascript">
    2323      jQuery(document).ready(function($) {
    2424        initializeFilters();
    25       <py:if test="batch_modify">
    26         initializeBatch();
    27       </py:if>
    2825        $("#group").change(function() {
    2926          $("#groupdesc").enable(this.selectedIndex != 0)
    3027        }).change();

I was unsure if script was allowed inside a form tag, but w3 validator says it's valid HTML and tests pass.

comment:3 by Peter Suter, 6 years ago

Just for historical context it might be interesting that the batchmodifyplugin originally used ITemplateStreamFilter and IRequestFilter. The proposal to integrate the plugin in Trac brings up the idea that these will no longer be needed and that it could perhaps be integrated directly inside query.py. The import was then added here (Github).

in reply to:  3 comment:4 by Ryan J Ollos, 6 years ago

Replying to psuter:

The import was then added here (Github).

That is interesting. Also of note, that change introduced the issue resolved in #11974.

comment:5 by Ryan J Ollos, 6 years ago

Committed comment:2 change in r15260, merged in r15261:r15262.

Last edited 6 years ago by Ryan J Ollos (previous) (diff)

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain Ryan J Ollos.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Ryan J Ollos 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.