SoylentNews / slashcode

The slashcode repository for SoylentNews. The initial code base was uploaded as it appeared on Sourceforge as of the last commit in September 2009
http://soylentnews.org
GNU General Public License v2.0
44 stars 22 forks source link

Changing threshold/breakthrough in poll collapses poll results #391

Closed jcrutchy closed 9 years ago

jcrutchy commented 9 years ago

Not sure if its intended behavior but it was unexpected. Would be nice to keep poll results above comments if threshold/breakthrough is changed.

submitted by exec from #Soylent @ irc.sylnt.us

microtodd commented 9 years ago

Looks like its the link from the "Change" button, the postback takes you to comments.pl instead of pollBooth.pl. The threshold GET args work on pollBooth.pl so maybe its simply a matter of adjusting that postback link.

paulej72 commented 9 years ago

the threshold and breakthrough buttons are part of a form that posts to comments.pl. That post goes to the Reply op for the comments.pl page. This op does not currently have an input to allow for redirect to the calling page. We can do that probably easiest via a hidden input in the form. We also need this feature to allow for returning to the point that a new comment is added. I believe that the ops might not be the same, but we would want the code to be similar.

Just to note that slash does have a redirect function, but it must be called before the page headers have been setup. Many of slash's pages have the header setup in the main function of the pl file and not in the individual op functions. This means that redirecting after doing some logic is hard. We may need to move the header create to each of the op functions instead of main so that we can do our logic first then redirect if needed back to the starting point.

Also note that TheMightyBuzzard fixed journals and articles by fxing the comments.pl page to display the journal or article at the top when changing these values. It is probably the easy way to do it, but not the best. We should just be returning directly to the page we were at instead of showing the new comments.pl page.

We may need to create a new op that does what we need for this and returns to the calling page.

TheMightyBuzzard commented 9 years ago

Sounds like the best option here is to split the bar with the "change" button to a different form that POSTs to pollBooth.pl rather than to comments.pl. Likely to require some template reworking but quite doable.

This will still leave the problem that you won't see the poll after hitting reply because I never made allowances for the poll booth when I put the "review" up top when you're on comments.pl replying.

paulej72 commented 9 years ago

This issue was moved to SoylentNews/rehash#150