In block configuration settings, if visible on all country checkbox is unchecked, then country select list should be made mandatory. As of now, it simply allows to Save configuration.

Comments

Vinay15 created an issue. See original summary.

Sonal.Sangale’s picture

Assigned: vinay15 » Sonal.Sangale
Status: Active » Needs review
StatusFileSize
new885 bytes

Adding code to make country select list mandatory when "Visible on all country" checkbox is unchecked.

Status: Needs review » Needs work

The last submitted patch, 2: making_country_select_list_mandatory-2717235-2.patch, failed testing.

rajeshwari10’s picture

Hi Sonal,
In your patch there were some coding standard issue fixed it.

rajeshwari10’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work
ashishdalvi’s picture

+++ b/block_country.module
@@ -117,14 +117,20 @@ function block_country_form_alter(&$form, &$form_state, $form_id) {
+
+function block_country_form_validate($form,&$form_state) {
+  if (($form_state['values']['block_visibility_country'] == 0) && (empty($form_state['values']['country_code']))) {
+    form_set_error('country_code', t('Select country field is required.'));
+  }
+}

Function documentation is missing.

https://www.drupal.org/coding-standards/docs#hooks

vinay15’s picture

Hey Ashish,

I have updated the patch at #4 with the function documentation.

Thanks,
Vinay

vinay15’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 8: block_country-making-country-list-mandatory-2717235-8-7.patch, failed testing.

ashishdalvi’s picture

Status: Needs work » Fixed

Thank you so much for patch.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.