Closed (won't fix)
Project:
Documentation
Component:
API documentation files
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
22 Nov 2011 at 14:18 UTC
Updated:
26 Mar 2025 at 08:56 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
jhodgdonMoving to documetation queue (the file to be edited is in that git repository).
Comment #2
jhodgdonTagging so #1421874: [meta] Documentation Issue Queue Cleanup doesn't have to look at API docs issues.
Comment #3
jhodgdontagging
Comment #4
David_Rothstein commentedLinking to the Drupal 8 version of this. The patch here could use similar text as that one does.
Comment #5
David_Rothstein commentedComment #6
shashikant_chauhan commentedI am unable to find starting point where I can make changes so that it is reflected in developer/topics/forms_api_reference.html
Comment #7
joachim commentedIt's the file developer/topics/forms_api_reference.html in the repo for this project. 7.x-1.x branch, I assume.
Comment #8
shashikant_chauhan commentedUnable to find such file "forms_api_reference.html" in drupal 7.x repo. Not sure if I am looking at a right place or not.
Comment #9
joachim commentedNot in the Drupal repo, in the repo for *this* project. This issue is not under the Drupal project! Click the tab that says 'Documentation' that's just above the breadcrumb.
Comment #10
shashikant_chauhan commentedAdding patch
Comment #11
shashikant_chauhan commentedScreenshots after applying the patch.
Comment #12
xem8vfdh commentedThank you VERY much @joachim and @sun for pointing out this useful behavior!
Comment #13
jhodgdonCan someone test the code in the proposed changes (see screenshot) and verify that it works correctly in a D7 form? Thanks!
Comment #14
joachim commentedThe adding of extra options looks ok, but there is a problem with the main form element that's being added: drupal_map_assoc() should not be used with translated values, as it means the stored keys will be different in different languages! Only the option labels should be translated.
(Also, is there any way that line breaks could be added to the source, as it's really hard to read it on very long lines.)
Comment #15
jhodgdonFeel free to add line breaks to the file.
Comment #16
shashikant_chauhan commented@joachim, I have removed the function "drupal_map_assoc" from docs.

After applying patch.
Radios:
Checkboxes

Comment #17
jhodgdonBy splitting the code line up into multiple lines, your patch has added a bunch of whitespace that shouldn't be on the page. For instance, it should look like
not
There should not be spaces around the (). Same with [].
Also because of splitting the lines, it is very difficult to look at the patch and see what has actually changed from the old version. It looks like the whole thing is completely different, but it actually isn't.
So... please make a new patch. Thanks!
Comment #18
shashikant_chauhan commented@jhodgdon, These whitespaces are added due to new line breaks. After removing those new line break it will look like
t('whatever')Eg: https://jsfiddle.net/shashi1028/e1Ltukn8/
Or should I create patch like
to remove spaces.
Comment #19
jhodgdonYes, I understood that the line breaks generated the extra spaces. Please remove them, rather than adding comments.
Why do I say this? Well, ... It is a general philosophy in the Drupal project as a whole, that patches should only address the actual problem in the issue. So, if you have an issue that says "We should add to this documentation an example showing how to set options", you should make a patch that does just that. Not a patch that also totally reformats that section of the file.
So, if you want to make a patch that reformats a file, you should use a separate issue to do that, not combine it with this issue.
Thanks!
Comment #20
shashikant_chauhan commentedHere is the new patch after removing line breaks.
Comment #21
bbombachiniThe patch applied evenly and seems good. Moving it to reviewed.
Comment #22
avpadernoComment #23
ncdevman commentedJust looked and reviewed the D7 form API reference examples. These additions are showing up.
Comment #24
ncdevman commentedComment #25
quietone commentedThanks for working to improve Drupal.
This is for the Drupal 7 Form API reference. Since Drupal 7 is past end-of-life this is now a "won't fix".
Work on documentation for form elements for supported versions of Drupal is at #2486967: [meta] Move/Create Form Element Documentation and #3313535: [Meta] Improve documentation for Render and Form Elements.
Comment #26
avpaderno