|
|
Polls seems broken
Posted under Development by Neil Darlow on Friday October 19 2001 @ 10:27AM EDT
|
With phpWebLog-0.5.2 when creating a new poll a couple of weirdnesses creep in.
1) The answers are saved out-of-sequence
2) The URLs in the browser entry bar have additional slashes
Is there a patch somewhere to fix this behaviour?
Regards,
Neil Darlow M.Sc.
|
|
|
|
Neil Darlow writes on Sunday October 21 2001 @ 05:51AM EDT: [ reply | parent ]
An Example:
Question: Ask a question?
Answer #1: Foo Bar
Answer #2: Bar Baz
Answer #3: Baz Foo
is saved in T_PollAnswers as:
... 2 Bar Baz
... 3 Baz Foo
... 1 Foo Bar
editing the poll with no changes and re-submitting saves:
... 3 Baz Foo
... 1 Foo Bar
... 2 Bar Baz
and editing again with no changes and re-submitting saves:
... 1 Foo Bar
... 2 Bar Baz
... 3 Baz Foo
Interestingly, the displayed order of the answers remained correct this time. I am confused as to why the ordering of records on T_PollAnswers should change at each submit.
The additional slashes are added as follows:
http://www.darlow.co.uk/admin/polls.php
http://www.darlow.co.uk//admin/polls.php
http://www.darlow.co.uk///admin/polls.php
Configuration is: apache-1.3.20, mod_php4-4.0.6, mysql-3.23.42, phpweblog-0.5.2 on FreeBSD 4.4.
Regards,
Neil Darlow M.Sc.
|
|
jason writes on Sunday October 21 2001 @ 03:45PM EDT: [ reply | parent ]
Thanks for this report. Since polls were stripped out of 0.5.3 and made into an addon, this looks like a bug in the polls addon.
|
|
|
Neil Darlow writes on Monday October 22 2001 @ 05:20AM EDT: [ reply | parent ]
Are addons present in 0.5.2? The polls code in that version looks pretty tightly integrated.
Regards,
Neil Darlow M.Sc.
|
|
|
|
jason writes on Monday October 29 2001 @ 12:27PM EST: [ reply | parent ]
Nope, the addons are being introduced in the next version
|
|
|
Neil Darlow writes on Monday October 22 2001 @ 09:07AM EDT: [ reply | parent ]
The additional slashes being added to the URL was caused by the re-circulation of $PHP_SELF.
I have stripped leading slashes from the URL with the following modification to F_pollVote in include/polls.inc.php.
Replace:
$VAR["Content"] .= F_admin("T_PollQuestions",$rid,$PHP_SELF);
With:
$VAR["Content"] .= F_admin("T_PollQuestions",$rid,substr($PHP_SELF,strspn($PHP_SELF,"/index.html")));
Regards,
Neil Darlow M.Sc.
|
|
Neil Darlow writes on Monday October 22 2001 @ 10:29AM EDT: [ reply | parent ]
The fix for random ordering of Poll Answers in the Poll Vote Block and Poll Edit Page seems to be a feature.
Studying the MySQL documentation, it appears that PRIMARY KEYs don't specify ordering on INSERTS to the table.
If you need deterministic ordering you must specify an ORDER BY in any select performed on the table.
For the Polls in phpweblog-0.5.2 it's necessary to add an ORDER BY Aid to three places in include/polls.inc.php and one place in include/edit.php.
I can provide a patch for both of these problems. Where should I send it?
Regards,
Neil Darlow M.Sc.
|
|
|
|
|