Edgewall Software
Modify

Opened 17 years ago

Closed 15 years ago

Last modified 15 years ago

#6130 closed defect (fixed)

[PATCH] Logging option checkbox is always blank.

Reported by: jenn@… Owned by: Christian Boos
Priority: normal Milestone: not applicable
Component: plugin/spamfilter Version: devel
Severity: normal Keywords: javascript
Cc: maarten@… Branch:
Release Notes:
API Changes:
Internal Changes:

Description

I've got the SpamFilter plugin installed on my 0.11dev system (r6021), and it's hard to tell from the admin page whether I've got the logging option on. I can check the "Enable" box in the "Logging" section, but when the page refreshes after saving, the checkbox is no longer checked.

Oddly, logging does seem to be enabled; I've got stuff on the monitoring page. This makes me wonder how I would turn monitoring off if I wanted to, since the checkbox is always empty…or maybe it turns logging off whenever I change settings and don't re-check the box. Let me know if you need me to investigate further; but for the moment it's certainly true that the checkbox isn't correctly reflecting the state of the option.

Attachments (0)

Change History (7)

comment:1 by maarten@…, 16 years ago

Cc: maarten@… added

I'm having the same problem. I am not sure whether logging is enabled, because there is nothing to see on the monitoring page. That can be either a good or a bad sign…

comment:2 by anonymous, 16 years ago

If you have the iniadmin plugin installed and enabled, you can look at the "spam-filter" section and check the radio boxes to set logging to either TRUE or FALSE - as a work-around until it may be solved sometimes (and yes, I have the same problem with 0.11 stable).

comment:3 by Valik, 15 years ago

The problem described here is a bug in "spam-filter/tracspamfilter/templates/admin_spamconfig.html". The javascript at the top of the file creates a click handler and then calls it immediately. This has the effect of inverting the state of the logging checkbox. From what I can tell the intent of invoking the event manually is to change the enabled state the purge age to match the logging checkbox.

I have solved the problem by explicitly setting the purge controls to the proper enabled state without invoking the click event.

The following block of code:

    <script type="text/javascript">
      $(document).ready(function() {
        $("#logging_enabled").click(function() {
          $("#purge_age").enable(this.checked);
        }).click();
      });
    </script>

Need replaced with this:

    <script type="text/javascript">
      $(document).ready(function() {
        var loggingEnabled = document.getElementById("logging_enabled");
        $("#purge_age").enable(loggingEnabled.checked);
        $("#logging_enabled").click(function() {
          $("#purge_age").enable(this.checked);
        });
      });
    </script>

comment:4 by anonymous, 15 years ago

Owner: changed from Matthew Good to Christian Boos
Summary: Logging option checkbox is always blank.[PATCH] Logging option checkbox is always blank.

Confirmed to work.

P.S. I'm the same anon as in #8257.

comment:5 by Christian Boos, 15 years ago

Keywords: javascript added

Can you please test again the slightly adapted patch committed as r8330? Hope I got this right on the first try, this time ;-)

comment:6 by anonymous, 15 years ago

Resolution: fixed
Status: newclosed

Jup. Seems to work fine.

comment:7 by Christian Boos, 15 years ago

Thanks for checking!

Modify Ticket

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