Closed (fixed)
Project:
NodeReview
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
27 Nov 2006 at 21:13 UTC
Updated:
2 Apr 2011 at 02:08 UTC
Jump to comment: Most recent file
Comments
Comment #1
Crell commented4.7 is now in maintenance mode, so new features should go against Drupal 5 only. Thanks.
Comment #2
gregglesok, here is a patch for 5.x.
Also, that first patch was soooooooo wrong. I don't know what I was thinking...
Comment #3
Crell commentedThis makes reviews optional unconditionally. That means you can't make the review portion required even if you wanted to. That's not really an improvement over it being required unconditionally (the current seutp).
If you can make it configurable per-axis or even per review type, that I'd commit.
Comment #4
gregglesWell, it is somewhat better in that you can make it required by using a hook_form_alter to set #required => TRUE whereas in the current condition (with the custom validation function) you can't do that. right?
I'm unlikely to write that feature as the site that it's on will probably never see life after this incarnation so I'm unassigning myself. so, if anyone needs this feel free to run with it.
Comment #5
najibx commentedI simply want to remove all review per axis and have 1 overall review (a must) at the bottom.
Completely Remove this. Simply remove #required' => TRUE will show the textarea, just not make it a must. so I remove it.
But instead I add this in function nodereview_form
I got the display and validation I wanted, but of course the data are not being save... then I realize I would hack too much, and will get into trouble later when upgrading. An option for this kind of customization is great!
Comment #6
summit commentedPatch works also on D6 version! greetings, Martijn
Comment #7
yaworsk commentedHi all,
I took a different approach. On the nodereview admin page, I provided a checkbox for the administrator to choose whether or not vote comments are required. This value is then saved to the database. Axes that require vote comments, as identified by the administrator, remain unchanged but axes that do not require vote comments are still visible and available for users to provide optional comments.
I dont know how to create a patch, sorry, but here is my code - you have to change a number of files and unfortunately, uninstall and reinstall the module which would lose your data...
from nodereview.install, add the following after line 110:
from nodereview.admin.inc:
replace line 48 with:
replace line 88 with:
replace line 97 with:
after line 137, add:
from nodereview.theme.inc:
after line 23, add:
after line 29, add:
replace line 35:
From nodereview_node_nodereview.inc:
replace line 128 to the comment for implementation of hook_validate with:
update line 150:
Hope this helps - if I messed up anywhere, let me know and I'll take a look again,
pete
Comment #8
danielhonrade commentedcommitted #7 by yaworsk with few modifications which will be available in 12 hours
added update on table install for upgrading those who have install the previous dev
/**
* Added description required
*/
function nodereview_update_1() {
$update = array();
$update[] = update_sql("ALTER TABLE {nodereview_axes} ADD `description_required` INT(1) DEFAULT '0' NOT NULL AFTER `description`");
return $update;
}
Comment #9
yaworsk commentedawesome, thanks for committing that. kept meaning to come back to it to create the patch but it seemed like there wasn't much interest in it and i've been busy...
Comment #10
danielhonrade commentedComment #11
Crell commentedRaw DDL queries should not be used in update hooks in D6. Instead, use this:
http://api.drupal.org/api/drupal/update.php/function/db_add_column/6
Daniel, please correct the update hook and then re-fix this issue.
Comment #12
yaworsk commentedjust reading the comments on the the db_add_column api page, should it actually use db_add_field? http://api.drupal.org/api/drupal/includes--database.pgsql.inc/function/d...
Comment #13
Crell commentedGr. Yes, yes it should. Bad me for confusing the two. (I think we fixed that in D7... :-) )
Comment #14
danielhonrade commentedHi Crell and Yaworsk,
I am guessing, a quick convert will look like this:
I haven't tried, will this work?
Comment #15
danielhonrade commentedOk, tested! committed to dev, available in 12hours.