One Hungarian user reported on Drupal.hu that the weight is not added to the filter tips form component, if only one format is available. This could result in the filter tips appear in unexpected places. The attached patch moves the weight setting into the general part of the filter tip form component construction.
| Comment | File | Size | Author |
|---|---|---|---|
| #16 | without.jpg | 12.32 KB | Balefire |
| #16 | with.jpg | 11.8 KB | Balefire |
| #11 | filter.module.patch | 783 bytes | drumm |
| #9 | filter.module.patch | 576 bytes | hanoii |
| #6 | filter.patch | 428 bytes | hanoii |
Comments
Comment #1
gábor hojtsyThis applies to both Drupal HEAD and 4.7.x, so if there is a 4.7.x prospect, the possibly this should be fixed there too.
Comment #2
gábor hojtsyIn fact, this needs some more work, since it is not the correct fix...
Comment #3
deelight commentedAdding:
just before "return $form" worked for me.
This gives :
Comment #4
drummNeeds a patch file. See http://drupal.org/patch.
Comment #5
edhel commentedHmm It's not fixed in 5.x & 6.x so far...
Comment #6
hanoiiI encountered the same problem and did the same as comment #3, with the difference that I just add the #weight information inside the esle clause.
Attached is the patch against drupal 5.7.
Comment #7
drummOn code review, I think this bug exists in all versions of Drupal, so moving to the highest. To reproduce, test when only one input format is available.
Comment #8
drummCode needs work because I think the #weight element should be defined in one of the array initializations, probably
$form['format']['guidelines'], not added afterward.Comment #9
hanoiiI reviewed the patch I commited but adding weight to
$form['format']['guidelines']won't fix this problem. The initialization must occur on the root element of the form, which is defined properly when formats are more than one but not if it is just one.I am attaching a modified patch of my first one (#6) with an initialization of a $form element with the weight element, but I believe it has to be a new line because there's no other initialization array to add this information to.
Comment #10
drummCorrected for code style. Does apply to all maintained versions of Drupal, so needs review for 7.x first.
Comment #11
drummComment #12
cburschkaApplies. I don't notice anything different on the node/add/page form when only one input format is available. What conditions should this be tested with?
Comment #14
cburschkaComment #15
catchMarking to active needs more info until there's steps to reproduce. Seems like this might not be valid at all.
Comment #16
Balefire commentedNot sure if this is correct for me to post here, but as catch said in comment #15
Ithought I'd show how I can reliably reproduce on my D5.14 installation & Opera 9.52, sometimes with Firefox 3 (but if it happens once on a content type, it will always be that way):
I have attached a couple of images (without = without the patch, with = with the patch) to show the difference. Hope this helps.
Comment #17
sunAlready fixed in 7.x: http://api.drupal.org/api/function/filter_form/7
However, that's not going to be backported to 6.x. Leaving decision to Gábor whether we still want to fix this in 6.x.
Comment #18
hanoiiI wonder if we can bump this issue for both 6.x or 5.x? I keep on patching this as it's annoying when you have more than one filter tip on a form. Just changing status so it's not postponed and not sure if there's more info to provide, it should be probably a decision of whether to fix this or not.
Comment #19
thedavidmeister commentedlooks like with 3 years of inactivity the decision to fix this is "no".
If we do want to pursue this, the patch in #11 no longer applies.
error: filter/filter.module: No such file or directory