When selecting "Scroll Box (CSS)" as display style, no scroll bars appear during user registration and profile editing. The T&C are displayed in full length in a div within a fieldset.
In the case of accepting a new version of the T&C everything is displayed just fine.
I'm using the Bartik theme.

Comments

kelvinwong’s picture

+1

kelvinwong’s picture

Status: Active » Needs review
StatusFileSize
new467 bytes

Patch to be reviewed

Status: Needs review » Needs work

The last submitted patch, legal_scroll_box_css.patch, failed testing.

The last submitted patch, legal_scroll_box_css.patch, failed testing.

japerry’s picture

StatusFileSize
new752 bytes

This code does the opposite of what should be happening in D7. A review of 7.12 shows
return theme('legal_display', array('form' => $form));

it should be...
$form = theme('legal_display', array('form' => $form));

japerry’s picture

Status: Needs work » Needs review

changing to needs review

Status: Needs review » Needs work

The last submitted patch, legal-css-scroll.patch, failed testing.

kelvinwong’s picture

You don't need to return $form in hook_form_alter()

kelvinwong’s picture

StatusFileSize
new473 bytes

I don't quite understand the error message. Perhaps try this?

japerry’s picture

The theme already takes the whole form, which isn't great -- it'd require rewriting the theme function so that its not doing the form population inside that function, but only doing styling to the specific legal element

kelvinwong’s picture

So would it help if we just apply theme to $form['legal'] instead of the whole form?

Can someone try this http://drupal.org/node/1356810#comment-6062646?

kelvinwong’s picture

No sorry, I just realize legal_scroll_box_css2.patch duplicate the username and password fields.

kelvinwong’s picture

All the theme function does is to add a css file and two extra form settings to the legal element. I can't see why there is a problem.

      $form['legal']['conditions']['#prefix' ] = '<div class="legal-terms">';
      $form['legal']['conditions']['#suffix' ] = '</div>';
Sborsody’s picture

The problem is the whole form is being sent through the theme function rather than the individual form item. It really messes things up, especially on the site I'm working on that has a multi-step user registration form. We should instead be attaching a theme function to the form item and the theme function should handle the individual form item. I'll post a patch later.

Sborsody’s picture

Version: 7.x-1.2 » 7.x-1.x-dev
Status: Needs work » Needs review
StatusFileSize
new689 bytes

Try this simple patch.

Sborsody’s picture

Status: Needs review » Needs work

Seems to revert to unthemed when the form errors.

Sborsody’s picture

Status: Needs work » Needs review
StatusFileSize
new1.09 KB

New patch.

IWasBornToWin’s picture

Just applied patch, works well!

illeace’s picture

The prefix and suffix added by the theme_legal_display() function are important because they build a wrapper div around the legal conditions field. This wrapper field (class="legal-terms") is the one that is set to be scrollable in the legal.css file. The real problem IMHO is that at the end of legal_form_user_register_form_alter() and legal_form_user_profile_form_alter() the output of the theme function is returned.

  return theme('legal_display', array('form' => $form));

Unfortunately, returning this value doesn't do any good because form_alter functions don't need nor use the return value. Instead they need to alter the $form variable, and the $form value isn't being altered by the form function because $form isn't passed by reference. Updating the last line of both functions to:

  $form = theme('legal_display', array('form' => $form));

updates the $form variable with the output of the theme function, so the prefix and suffix are maintained. This seemed to fix my problems with this issue.

JayShoe’s picture

Hello,

Post #17 works... But the patch produces errors on the 7.x-1.4 branch.

patching file legal.module
Hunk #1 succeeded at 141 (offset -1 lines).
Hunk #2 succeeded at 281 with fuzz 1 (offset 20 lines).
Hunk #3 FAILED at 358.

Even after this failure, it still seems to work correctly.

This patch should really be committed... It's broken functionality...

alexandrezia’s picture

Issue summary: View changes
StatusFileSize
new1.11 KB

Thanks for this solution, it worked great here.
I'm just uploading an updated patch that applies to version 1.5

ychangGN’s picture

Hi,

Same as post #20. I got errors when patching.

$ patch < 1356810-no-scroll-bars-2.patch
patching file `legal.module'
Hunk #1 succeeded at 141 (offset -1 lines).
Hunk #2 succeeded at 282 with fuzz 1 (offset 21 lines).
Hunk #3 FAILED at 379.

Unfortunately, it does not fix the unscrollable problem in my case. But, thanks anyway.

alexandrezia’s picture

ychangGN,

As per your comment, you've applied patch #2, why don't you try patch #21 aginst module version 1.5?
> $ patch < 1356810-no-scroll-bars-2.patch

hussainweb’s picture

Status: Needs review » Reviewed & tested by the community

Patch in #21 works great. I patched it against 7.x-1.5 and just got this. I see a nicely formatted scroll box.

hw@hwvmsrv:/.../sites/all/modules/contrib/legal$ patch -p1 < /var/www/1356810-no-scroll-bars-21.patch
patching file legal.module
Hunk #1 succeeded at 141 with fuzz 1.
attheshow’s picture

Patch 21 worked for me in a purchased theme.

robert castelo’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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