Needs review
Project:
Compact Forms
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
3 Mar 2010 at 21:24 UTC
Updated:
2 May 2018 at 12:23 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
mark. commentedWhen you say "a version loads without compact forms," do you mean the page loads with the user's last entered text stuck behind the compact form label, and clicking the compact label does not make it fade out as its supposed to?
Comment #2
sunI'd also like to know more about this. The code/patch looks valid.
Comment #3
NickWebman commentednice patch! I so needed this!
I received the following when patching (and mind you, I know very little when it comes to command line anything)...
-bash-3.2$ patch < compact_forms_pre_render.patch
patching file compact_forms.module
Hunk #1 succeeded at 42 with fuzz 1.
Hunk #2 FAILED at 69.
Hunk #3 succeeded at 93 (offset 12 lines).
1 out of 3 hunks FAILED -- saving rejects to file compact_forms.module.rej
Although it seems to work wonderfully.
Thanks again,
Nick
Comment #4
nedjoPatch needs updating.
What I mean is that, in preview mode, there is no compact forms behaviour--forms are in their regular, non-compact format.
Comment #5
NickWebman commentedzywiec: the OP is saying that when a form submission fails (ie. when a required field is not filled out) compact forms no longer takes effect. See attached image for example. After a failed attempt, the labels appear spaced wonkily, and they no longer fade in/out on focus/blur. This patch resolves the issue at hand.
Comment #6
acThis patch works on the 7.x version of the module but throws a notice:
Notice: Undefined variable: form_id in compact_forms_pre_render() (line 78 of sites/all/modules/compact_forms/compact_forms.module).
Any chance of updating for 7.x and commiting? As it is compact forms is unusable.
Comment #7
Anonymous (not verified) commentedThis is still an issue in the 7.x branch, and the batch now fails per post #3. Anyway we can clean this up? Certainly makes compact_forms about unusable, as any input error causes the module to fail.
Edit: I typed 6, meant 7.
The patch does work, but it throws the error from #6. I'm going to see if I can figure it out and post my results.
Edit 2:
Line 55:
static $css_ids, $form_ids, $loaded, $field_size, $descriptions;
adding $form_id to this list seemed to clean up the error. The module still works great. Mine now looks like:
static $css_ids, $form_ids, $loaded, $field_size, $descriptions, $form_id;
Comment #8
cristhian commentedAbsolutely agree with #7!
Comment #9
sunThanks for reporting, reviewing, and testing! Committed attached patch to 7.x-1.x.
A new development snapshot will be available within the next 12 hours. This improvement will be available in the next official release.
The proper fix for D7 would be to use #attached instead, but I don't have time to work on that right now, and this quick stop-gap fix is valid, too (although less performant).
Comment #10
JvE commentedFor D7:
- moving code back to form_alter
- using #attached rather than _compact_forms_include_js in prerender
- using hook_element_info_alter() to process the elements
Comment #11
Christophe Bourgois commentedUsing the compact_forms 7.x-1.0 I am facing the same problem.
Looking to different scripts I didn't find the one for my version.
So here is the solution working for me :
In the compact_forms_form_alter function, replace the lines
by the lines
Then replace the _compact_forms_include_js function by
Comment #12
mfrosch commentedStumbled about the same.
For me I had to add another form id in compact forms configuration
On failure submit form id switched from article-node-form to article-node-form--2