Mismatch of approvals when new posts arrive after form is loaded

digi24 - November 11, 2009 - 14:54
Project:modr8
Version:6.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active
Description

Hi,

I have been using modr8 with slight modifications for a while now. As long as the traffic was low, everything was fine, but with increasing post frequency I noticed that there is something going wrong.

In short, upon submission and before processing the form the module reads from the database. IIf you are using the default sorting (newest first), nodes get duplicated, if you chenge the sorting, nodes that were not displayed have the default action executed.

This bug report is related to #194110: 2 Entries created in Moderation Log / Number of Posts in moderation block.

#1

pwolanin - November 12, 2009 - 22:11

Any suggestions for how to approach the solution?

#2

digi24 - November 13, 2009 - 18:03

The error is not critical, it occurs only under certain conditions and if the default action is set to something other than "nothing".

Unfortunatelly I am not experienced with Form-API, but I am quite sure, that there is some conflict between the module preparing the form for input and the submit handler. (What I do not understand about Form-Api: is there a way to tell the form to submit it directly to a certain function/menu callback? I guess this would solve the problem)

#3

pwolanin - November 13, 2009 - 19:02

One possible solution would be to put some hidden values into the form so we know for sure which loads were originally displayed.

Form API rebuilds the form on submission to validate the input is not hacked, so if the database has changed and that makes different nodes appear, things could get odd.

 
 

Drupal is a registered trademark of Dries Buytaert.