I was having trouble enabling the fivestar dev version with javascript enabled on FF 2.0.0.9
If I disabled javascript, I was able to enable Fivestar.
Enabling fivestar works fine w/ javascript on Safari 3.0.3
I was using the following versions:
* Fresh install of Drupal 5.3
* VotingAPI 5.x-1.5
* DRUPAL-5 branch of Fivestar downloaded via:
cvs -z6 -d:pserver:anonymous:anonymous@cvs.drupal.org:/cvs/drupal checkout -r DRUPAL-5 -d fivestar contributions/modules/fivestar
To reproduce the bug:
* enable fivestar & votingapi
* Go to admin/content/types/page
* Click on Enable Fivestar rating
* Click on save content type
It doesn't save the fivestar enable for the content type, and incorrectly redirects to the same page: /admin/content/types/page
When disabling javascript, it will properly save and redirect to admin/content/types
I also installed the devel module and enabled the display page redirection option, along with displaying the queries.
** Here are the Queries of the BUG with javascript turned on:
drupal_lookup_path SELECT COUNT(pid) FROM url_alias
module_list SELECT name, filename, throttle FROM system WHERE type = 'module' AND status = 1 ORDER BY weight ASC, filename ASC
cache_get SELECT data, created, headers, expire FROM cache_menu WHERE cid = '1:en'
_node_types_build SELECT nt.type, nt.* FROM node_type nt ORDER BY nt.type ASC
list_themes SELECT * FROM system WHERE type = 'theme'
block_list SELECT DISTINCT b.* FROM blocks b LEFT JOIN blocks_roles r ON b.module = r.module AND b.delta = r.delta WHERE b.theme = 'garland' AND b.status = 1 AND (r.rid IN (2) OR r.rid IS NULL) ORDER BY b.region, b.weight, b.module
system_region_list SELECT * FROM system WHERE type = 'theme' AND name = 'garland'
sess_write SELECT sid FROM sessions WHERE sid = 'aa93d2v6urv4qfkcr11glnt9u2'
sess_write UPDATE sessions SET uid = 1, cache = 0, hostname = '192.168.1.43', session = 'form|a:1:{s:32:\"77b76ff4f2e38c2b5aab3dab7caebcd8\";a:2:{s:9:\"timestamp\";i:1195334143;s:4:\"args\";a:1:{i:0;s:14:\"system_modules\";}}}', timestamp = 1195334162 WHERE sid = 'aa93d2v6urv4qfkcr11glnt9u2'
sess_write UPDATE users SET access = 1195334162 WHERE uid = 1
** Queries from CORRECT BEHAVIOR: with Javascript turned off:
drupal_lookup_path SELECT COUNT(pid) FROM url_alias
module_list SELECT name, filename, throttle FROM system WHERE type = 'module' AND status = 1 ORDER BY weight ASC, filename ASC
cache_get SELECT data, created, headers, expire FROM cache_menu WHERE cid = '1:en'
_node_types_build SELECT nt.type, nt.* FROM node_type nt ORDER BY nt.type ASC
list_themes SELECT * FROM system WHERE type = 'theme'
node_type_save SELECT * FROM node_type WHERE type = 'page'
node_type_save UPDATE node_type SET type = 'page', name = 'Page', module = 'node', has_title = 1, title_label = 'Title', has_body = 1, body_label = 'Body', description = 'If you want to add a static page, like a contact page or an about page, use a page.', help = '', min_word_count = 0, custom = 1, modified = 1, locked = 0 WHERE type = 'page'
db_lock_table LOCK TABLES variable WRITE
variable_set DELETE FROM variable WHERE name = 'node_options_page'
variable_set INSERT INTO variable (name, value) VALUES ('node_options_page', 'a:1:{i:0;s:6:\"status\";}')
db_unlock_tables UNLOCK TABLES
cache_clear_all DELETE FROM cache WHERE cid = 'variables'
db_lock_table LOCK TABLES variable WRITE
variable_set DELETE FROM variable WHERE name = 'comment_page'
variable_set INSERT INTO variable (name, value) VALUES ('comment_page', 's:1:\"0\";')
db_unlock_tables UNLOCK TABLES
cache_clear_all DELETE FROM cache WHERE cid = 'variables'
db_lock_table LOCK TABLES variable WRITE
variable_set DELETE FROM variable WHERE name = 'fivestar_page'
variable_set INSERT INTO variable (name, value) VALUES ('fivestar_page', 'i:1;')
db_unlock_tables UNLOCK TABLES
cache_clear_all DELETE FROM cache WHERE cid = 'variables'
db_lock_table LOCK TABLES variable WRITE
variable_set DELETE FROM variable WHERE name = 'fivestar_stars_page'
variable_set INSERT INTO variable (name, value) VALUES ('fivestar_stars_page', 's:1:\"5\";')
db_unlock_tables UNLOCK TABLES
cache_clear_all DELETE FROM cache WHERE cid = 'variables'
db_lock_table LOCK TABLES variable WRITE
variable_set DELETE FROM variable WHERE name = 'fivestar_style_page'
variable_set INSERT INTO variable (name, value) VALUES ('fivestar_style_page', 's:13:\"average_combo\";')
db_unlock_tables UNLOCK TABLES
cache_clear_all DELETE FROM cache WHERE cid = 'variables'
db_lock_table LOCK TABLES variable WRITE
variable_set DELETE FROM variable WHERE name = 'fivestar_unvote_page'
variable_set INSERT INTO variable (name, value) VALUES ('fivestar_unvote_page', 'i:0;')
db_unlock_tables UNLOCK TABLES
cache_clear_all DELETE FROM cache WHERE cid = 'variables'
db_lock_table LOCK TABLES variable WRITE
variable_set DELETE FROM variable WHERE name = 'fivestar_position_teaser_page'
variable_set INSERT INTO variable (name, value) VALUES ('fivestar_position_teaser_page', 's:6:\"hidden\";')
db_unlock_tables UNLOCK TABLES
cache_clear_all DELETE FROM cache WHERE cid = 'variables'
db_lock_table LOCK TABLES variable WRITE
variable_set DELETE FROM variable WHERE name = 'fivestar_position_page'
variable_set INSERT INTO variable (name, value) VALUES ('fivestar_position_page', 's:5:\"below\";')
db_unlock_tables UNLOCK TABLES
cache_clear_all DELETE FROM cache WHERE cid = 'variables'
db_lock_table LOCK TABLES variable WRITE
variable_set DELETE FROM variable WHERE name = 'fivestar_comment_page'
variable_set INSERT INTO variable (name, value) VALUES ('fivestar_comment_page', 's:1:\"0\";')
db_unlock_tables UNLOCK TABLES
cache_clear_all DELETE FROM cache WHERE cid = 'variables'
_node_types_build SELECT nt.type, nt.* FROM node_type nt ORDER BY nt.type ASC
_node_types_build SELECT nt.type, nt.* FROM node_type nt ORDER BY nt.type ASC
_node_types_build SELECT nt.type, nt.* FROM node_type nt ORDER BY nt.type ASC
cache_clear_all DELETE FROM cache_page
cache_clear_all DELETE FROM cache_menu
_menu_build SELECT m.mid, m.* FROM menu m ORDER BY m.mid ASC
_menu_build SELECT m.mid, m.* FROM menu m ORDER BY m.mid ASC
block_list SELECT DISTINCT b.* FROM blocks b LEFT JOIN blocks_roles r ON b.module = r.module AND b.delta = r.delta WHERE b.theme = 'garland' AND b.status = 1 AND (r.rid IN (2) OR r.rid IS NULL) ORDER BY b.region, b.weight, b.module
system_region_list SELECT * FROM system WHERE type = 'theme' AND name = 'garland'
sess_write SELECT sid FROM sessions WHERE sid = 'aa93d2v6urv4qfkcr11glnt9u2'
sess_write UPDATE sessions SET uid = 1, cache = 0, hostname = '192.168.1.43', session = 'form|a:1:{s:32:\"77b76ff4f2e38c2b5aab3dab7caebcd8\";a:2:{s:9:\"timestamp\";i:1195334143;s:4:\"args\";a:1:{i:0;s:14:\"system_modules\";}}}', timestamp = 1195334397 WHERE sid = 'aa93d2v6urv4qfkcr11glnt9u2'
sess_write UPDATE users SET access = 1195334397 WHERE uid = 1
Turning off javascript can enable fivestar.
But if I reenable javascript and try to disable fivestar, then I see the same behavior.
Comments
Comment #1
designerbrent commentedWhile I haven't done the DB query dump, I can say that I have the same problem. When i disable Javascript, I can enable the module but with Javascript disabled, it will not enable the module and just refresh the page. Also, is does not save ANY of the changes on that page.
Comment #2
seanrSame here.
Is this a recently introduced bug? Anyone here been using it for a while in Fx?
Comment #3
quicksketchI put in some work the content type settings page tonight, but I've been unable to reproduce this bug. Could someone that is seeing the problem try out the latest dev and try it out again? Hopefully the changes that went in will correct this problem also. Thanks!
Comment #4
dldege commentedI just grabbed latest version using -r DRUPAL-5 (fivestar.module /* $Id: fivestar.module,v 1.2.2.39 2007/11/30 20:41:03 quicksketch Exp $ */) and had the same issue.
To get around it I changed fivestar-admin.js so that it will not run any of its code (changed it to if (!Drupal.jsEnabled) {)
I was then able to submit my settings. With that js enabled the settings are not saved as mentioned above.
I did a little debugging before finding this thread and noticed that when the js is enabled the custom submit function
is never called when you submit the node type form. Is the JS fivestar preview thing somehow messing with the form submit handling on the client side?
Comment #5
dldege commentedI noticed that the vote preview in the node type form also still submits an ajax vote for an invalid node. Overall, it looks like the preview functionality is somehow causing the issues. I am using FF 10.0.0.10 BTW and it doesn't work at all (the preview) in IE7 but ironically, this allows the form submit to work correctly.
Comment #6
KentBye commentedFYI: Just downloaded a fresh copy of the dev, and it is still re-directing to the admin/content/types/page on submit.
Haven't tried to do dldege's fix at all yet, but disabling js does allow the form to be submitted correctly.
Comment #7
quicksketchHmm, I'm still stumped why I can't reproduce this issue at all. I've installed a fresh Drupal 5 and used my normal sandbox, but in neither case can I prevent the fivestar settings from being saved. Please continue to dig into the issue.
Comment #8
quicksketchWhile investigating the cause of this bug today, I found another bug to fix: that the preview wasn't being populated properly without javascript. After populating the previews with the regular non-js radio buttons, the form would no longer submit, just as this issue was describing.
The problem was the Fivestar previews loading a second
<form>tag and worse, duplicate form_id and form_token hidden elements. One of these three things was preventing the form from being submitted. The fivestar preview now strips the output of these items to prevent them from causing troubles. Right now it's just with a regex, but we'll see if there's a way to clean that up further. Thanks for the help guys!Comment #9
(not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.