Closed (fixed)
Project:
Legal
Version:
7.x-1.x-dev
Component:
Code
Priority:
Minor
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
30 Nov 2011 at 11:11 UTC
Updated:
5 Feb 2017 at 15:04 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
kelvinwong commented+1
Comment #2
kelvinwong commentedPatch to be reviewed
Comment #5
japerryThis 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));Comment #6
japerrychanging to needs review
Comment #8
kelvinwong commentedYou don't need to return $form in hook_form_alter()
Comment #9
kelvinwong commentedI don't quite understand the error message. Perhaps try this?
Comment #10
japerryThe 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
Comment #11
kelvinwong commentedSo 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?
Comment #12
kelvinwong commentedNo sorry, I just realize legal_scroll_box_css2.patch duplicate the username and password fields.
Comment #13
kelvinwong commentedAll 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.
Comment #14
Sborsody commentedThe 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.
Comment #15
Sborsody commentedTry this simple patch.
Comment #16
Sborsody commentedSeems to revert to unthemed when the form errors.
Comment #17
Sborsody commentedNew patch.
Comment #18
IWasBornToWin commentedJust applied patch, works well!
Comment #19
illeace commentedThe 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.
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:
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.
Comment #20
JayShoe commentedHello,
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...
Comment #21
alexandrezia commentedThanks for this solution, it worked great here.
I'm just uploading an updated patch that applies to version 1.5
Comment #22
ychangGN commentedHi,
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.
Comment #23
alexandrezia commentedychangGN,
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
Comment #24
hussainwebPatch in #21 works great. I patched it against 7.x-1.5 and just got this. I see a nicely formatted scroll box.
Comment #25
attheshow commentedPatch 21 worked for me in a purchased theme.
Comment #26
robert castelo commentedFixed with patch from https://www.drupal.org/node/2026555.