Ticket #23 (closed defect: fixed)

Opened 6 years ago

Last modified 4 years ago

Ignore null changes

Reported by: dom 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

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

Change History

Changed 6 years ago by dom

  • summary changed from IVORW@cpan.org to Ignore null changes

Changed 6 years ago by dom

  • component set to openguides

Changed 5 years ago by dom

  • type changed from enhancement to defect

Changed 5 years ago by dom

  • owner set to Nobody

Changed 4 years ago by tgj

  • owner changed from Nobody to tgj
  • status changed from new to assigned

Changed 4 years ago by tgj

Changed 4 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.

Changed 4 years ago by dom

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.

Changed 4 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

Changed 4 years ago by dom

  • status changed from assigned to closed
  • resolution set to fixed

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

Note: See TracTickets for help on using tickets.