For some applications it is recommended to check the postal- and phone-fields, but in other cases it would be good to allow them to be empty. The admin should be able to set if the fields are required or not.

In my case I only deleted the following lines to allow empty postal- and phone-fields for now:

...
274 $postal= $edit["form_field_postal"] ;
275 $phone = $edit["form_field_phone"] ;
...
301 if (empty($postal) && variable_get ("feedback_field_postal", "") ) {
302 $error_msg .= t("Error: Postal is required") . "
";
303 }
304
305 if (empty($phone) && variable_get ("feedback_field_phone", "") ) {
306 $error_msg .= t("Error: Phone is required") . "
";
307 }
...

Thanks for this nice tool!
Dave

CommentFileSizeAuthor
#1 feedback.module_3.patch1.17 KBdavidjany

Comments

davidjany’s picture

Version: » 4.6.x-1.x-dev
Status: Active » Needs review
StatusFileSize
new1.17 KB

I´ve just written a patch to add two options to the feedback-settings.

...
+  $output .= form_checkbox (t("Postal Address required"),
+    "feedback_field_postal_required", 1,
+      variable_get("feedback_field_postal_required", 0) );
+
+  $output .= form_checkbox (t("Phone Number required"),
+    "feedback_field_phone_required", 1,
+      variable_get("feedback_field_phone_required", 0) );
+
   $output .= form_checkbox (t("Log all feedback attempts to watchdog"), "feedback_logging", 1,
     variable_get("feedback_logging", "1") );
...
+  if (variable_get("feedback_field_postal_required", 1)) 
   if (empty($postal) && variable_get ("feedback_field_postal", "") ) {
...
+  if (variable_get("feedback_field_phone_required", 1)) 
   if (empty($phone) && variable_get ("feedback_field_phone", "") ) {
...

Is it right for You, kbahey?

sun’s picture

Status: Needs review » Closed (won't fix)

Development on Feedback module v1.x has ended. Beginning from 2.x, the Feedback module has been replaced with a completely different module with a different purpose. Please note that Feedback 2.x is not compatible with 1.x. See #279636: Turn Feedback into user feedback module for further information.

There will be a final 5.x-1.1 release with all existing and tested patches in the issue queue applied. If you need the functionality of the Feedback 1.x module, the Contact module in Drupal core as well as the contributed Webform module are recommended replacements. However, there is no migration path to those modules.

Marking as won't fix.

Feel free to re-open this issue if you want to see this patch in the last 5.x-1.1 release.