Opened 16 years ago

Closed 13 years ago

#23 closed defect (fixed)

Ignore null changes

Reported by: Dominic Hargreaves Owned by: tgj
Priority: normal Milestone:
Component: openguides Version:
Severity: normal Keywords: patch
Cc:

Description

Mon Oct 17 03:20:56 2005 IVORW - Ticket created [Reply] [Comment]

Subject: Ignore null changes

Currently, OpenGuides will faithfully create a new version of a page if you ask it to, even when the contents and metadata are identical.

If both content and metadata are identical to the previous version, don't save the change or up the version number. The existing redirect logic will take the user back to the page - unaltered.

The present situation leads to RecentChanges getting polluted, both with automatic robot requests, and newbie edits.

Download (untitled) 449b

Fri Nov 11 07:33:03 2005 guest - Correspondence added [Reply] [Comment]

[IVORW - Mon Oct 17 03:20:56 2005]:

If both content and metadata are identical to the previous version,

don't save the change or up the version number. The existing redirect logic will take the user back to the page - unaltered.

We already have a checksum mechanism, this would seem to be a bug in that it is not being called.

Download (untitled) 340b

Mon Nov 14 19:47:35 2005 6bed-rgew@… - Comments added [Reply] [Comment]

Date: Tue, 15 Nov 2005 00:54:02 +0000 From: 6bed-rgew@… To: comment-OpenGuides@… Subject: Re: [cpan #15092] Ignore null changes RT-Send-Cc:

Guest via RT wrote:

[IVORW - Mon Oct 17 03:20:56 2005]:

If both content and metadata are identical to the previous version,

don't save the change or up the version number. The existing redirect logic will take the user back to the page - unaltered.

We already have a checksum mechanism, this would seem to be a bug in that it is not being called.

I think the problem could be that the checksum is including certain irrelevant metadata fields in the data, such as contributor/IP address, minor change, etc. Don't have time to verify this, but it's a thought.

Attachments (1)

decline_null_change.patch (4.8 KB) - added by tgj 13 years ago.

Download all attachments as: .zip

Change History (10)

comment:1 Changed 16 years ago by Dominic Hargreaves

Summary: IVORW@cpan.orgIgnore null changes

comment:2 Changed 16 years ago by Dominic Hargreaves

Component: openguides

comment:3 Changed 14 years ago by Dominic Hargreaves

Type: enhancementdefect

comment:4 Changed 14 years ago by Dominic Hargreaves

Owner: set to Nobody

comment:5 Changed 13 years ago by tgj

Owner: changed from Nobody to tgj
Status: newassigned

Changed 13 years ago by tgj

Attachment: decline_null_change.patch added

comment:6 Changed 13 years ago by tgj

Keywords: patch added

Confirmed that two consecutive versions with no changes do have the same checksum. So it's not that the checksum includes irrelevant metadata, but rather that the checksum isn't checked.

Attached patch is just a simple check for an identical checksum in Wiki::Toolkit::Store::Database. If the checksum is identical, the change is aborted.

The included test works okay. Haven't tested the patch's interoperation with openguides, but it looks like the (null) change will be silently rejected (no indication given to user). To improve this would need an API change for Wiki Toolkit to indicate that a change has been declined and provide a reason why. Still, this patch might be an improvement on the current situation.

comment:7 Changed 13 years ago by Dominic Hargreaves

Patch doesn't work for me:

t/010_metadata.........................Unhandled error: [Can't use string ("51.911") as an ARRAY ref while "strict refs" in use at /home/dom/working/wiki-toolkit-2/wiki-toolkit/trunk/blib/lib/Wiki/Toolkit/Store/Database.pm line 291.
] at /home/dom/working/wiki-toolkit-2/wiki-toolkit/trunk/blib/lib/Wiki/Toolkit.pm line 847

error comes from the _checksum method, which is being called by the patch. Haven't dug further yet.

comment:8 Changed 13 years ago by kake

I've fixed the problem Dom notes above, and applied the patch as changeset 477 in Wiki::Toolkit - http://www.wiki-toolkit.org/changeset/477

comment:9 Changed 13 years ago by Dominic Hargreaves

Resolution: fixed
Status: assignedclosed

This is also wiki-toolkit:ticket:43 and has now been fixed.

Note: See TracTickets for help on using tickets.