Closed (fixed)
Project:
Bootstrap
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
28 Jan 2013 at 10:33 UTC
Updated:
13 Feb 2013 at 02:20 UTC
See #1874770: [form API] how to add html value on button [SOLVED] for another guy with exactly the same issue as me.
Basically I am looking to add a submit button to the page with the form API. I am setting the #value to contain an icon and the text I wish it to contain. As the code presently stands it is impossible due to the check_plain() that is hard coded in form.inc (causing any HTML to be escaped).
I propose removing this, in favour of allowing your themers to perform any data sanitisation that may be required.
Simple patch attached.
| Comment | File | Size | Author |
|---|---|---|---|
| bootstrap-remove-check-plain.patch | 928 bytes | wiifm |
Comments
Comment #1
wiifmchange title to be more descriptive.
Comment #2
wundo commentedCommitted, thanks!
Comment #3
wiifmThanks for that!
For future reference it is nice to attribute the commits to the original author e.g.
git commit -m "Issue #1900786 by wiifm: Fixed Remove check_plain() around a submit button's #value." --author="wiifm <wiifm@358731.no-reply.drupal.org>"There is a handy greasemonkey script dreditor that can make this entire commit message for you too.
Comment #4
wundo commentedNote that I did attributed to you in the commit message.
Comment #5
wiifmThe commit message is good, but the author of the commit is yourself
http://drupalcode.org/project/bootstrap.git/commit/48a0a60
If the
--author="wiifm <wiifm@358731.no-reply.drupal.org>"is added on the end, then it shows up as a commit by me to the repository (and on my user profile for instance) ;) If you want to encourage others to contribute to the theme, this is a good way to help that.Have a great day
Comment #6
natted commentedHi wiifm,
You raise a good point. I'll try update my process a little. I don't think wundo did so intentionally, the maintainer instructions don't have much clarity on the subject and there are multiple guides on drupal.org each with conflicting information.
To help you get commit recognition, you may want to consider committing your patch locally and then creating the patch as per:
git format-patch LOCAL_COMMIT_ID --stdout > [project_name]-[short-description]-[issue-number]-[comment-number].patchReplace LOCAL_COMMIT_ID with the id of the commit ( easily seen by typing
git log).The result is a patch which has your commit message and author information included.
We can then use
git amto apply the patch which should retain your original commit and authorship information.Personally, I'm not sure of the best approach with multiple authors, if you know of a good strategy - let me know.
Cheers.