Comments

pcambra’s picture

Status: Active » Needs review

Setting to needs review

pcambra’s picture

Status: Needs review » Needs work

We need to delete on uninstall all variables that have been created.

jonathan_hunt’s picture

Status: Needs work » Needs review
StatusFileSize
new2.88 KB

Good call. Amended patch attached.

mr.baileys’s picture

Status: Needs review » Needs work

Reviewed and tested the patch, and it looks good to me. My only gripe is the fact that the title of the form element says "Position checkbox below content.", and then gives you the option to position below or above, which is confusing.

philipz’s picture

I wonder if it is possible to put the checkbox below/above the pane so it stays visible even if the pane is collapsed ?
This way the user could check that he/she agrees to terms of service but doesn't have to see the terms of service all the time. If someone would like to read them he would just expand them.

EDIT:
I moved the 'termsofservice' checkbox to $form['buttons']form array but it's not validated as required there.

jonathan_hunt’s picture

Version: 7.x-1.x-dev » 7.x-1.0
Status: Needs work » Needs review
StatusFileSize
new2.96 KB

Rerolled patch against stable version.

@mr.baileys Agreed, I've tidied the text in this patch.

@philipz Your idea makes sense, but I suggest you raise it in a separate issue.

luksak’s picture

StatusFileSize
new2.73 KB

I rerolled the patch against the latest version. I had to fix the issue that the exact opposite setting was being applied. Now it works perfectly. Ready to be commited?

pcambra’s picture

Status: Needs review » Needs work

Looks nice! thanks. Some minor fixes yet:

+++ b/modules/commerce_extra_panes_termsofservice/commerce_extra_panes_termsofservice.install
@@ -15,5 +15,6 @@ function commerce_extra_panes_termsofservice_uninstall() {
\ No newline at end of file

A line at the end of the file is needed

+++ b/modules/commerce_extra_panes_termsofservice/commerce_extra_panes_termsofservice.module
@@ -54,6 +61,7 @@ function commerce_extra_panes_termsofservice_form_alter(&$form, &$form_state, $f
+              '#weight' => variable_get('cep_tos_position_' . $pane_id, 'below') == 'above' ? 10 : -10,

Shouldn't be the weight relative? a +1/-1 of the other element will do it

luksak’s picture

Status: Needs work » Needs review
StatusFileSize
new3.35 KB

Changes implemented.

pcambra’s picture

Status: Needs review » Needs work
+++ b/modules/commerce_extra_panes_termsofservice/commerce_extra_panes_termsofservice.install
@@ -15,5 +15,6 @@ function commerce_extra_panes_termsofservice_uninstall() {
\ No newline at end of file

A line at the end of the file is still missing

+++ b/modules/commerce_extra_panes_termsofservice/commerce_extra_panes_termsofservice.module
@@ -54,14 +62,17 @@ function commerce_extra_panes_termsofservice_form_alter(&$form, &$form_state, $f
+              '#weight' => variable_get('cep_tos_position_' . $pane_id, 'below') == 'above' ? 1 : -1,

I think that instead of doing the weight absolute could be $form[$pane_id]['#attributes']['#weight'] +1 -1

luksak’s picture

I cant get rid of the "No newline at end of file" git thing... I tried saving it both in TextMate an Sublime.

Well, I set the weight of both elements hard coded. How should it be dynamic?

mr.baileys’s picture

+++ b/modules/commerce_extra_panes_termsofservice/commerce_extra_panes_termsofservice.moduleundefined
@@ -45,6 +52,7 @@ function commerce_extra_panes_termsofservice_form_alter(&$form, &$form_state, $f
+    dsm($form);

Left-over debug statement.

+++ b/modules/commerce_extra_panes_termsofservice/commerce_extra_panes_termsofservice.moduleundefined
@@ -54,14 +62,17 @@ function commerce_extra_panes_termsofservice_form_alter(&$form, &$form_state, $f
+    dsm($form);

Another left-over debug statement.

pcambra’s picture

Status: Needs work » Fixed

And committed, thanks all.

I've modified these things:

  • Cleaned up the debug messages
  • Changed the default position to be below, as it was the opposite (the text says position of the checkbox)
  • Added #states for improving the UI

Status: Fixed » Closed (fixed)

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