Needs work
Project:
Drupal core
Version:
main
Component:
documentation
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
23 Oct 2015 at 12:42 UTC
Updated:
7 Apr 2026 at 13:19 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
metzlerd commentedComment #3
metzlerd commentedComment #4
rakesh_verma commentedCan a newbie help in this issue?
Comment #5
metzlerd commentedAbsolutely, provided you are a bit of a developer. You can use the existing documentation as a guide. What I have been doing is trying to use these elements in my own sandbox module, and then copying/pasting code examples into the comments. If that sounds like something you can do, by all means jump in. Let me know if there is anything that I can do to help you along.
Comment #6
metzlerd commented@rekesh_verma: You didn't assign so I'm assuming that you decided not to work on this. Let me know if I'm wrong about that.
Comment #7
rakesh_verma commented@metzlerd: Definitely I want to work on this one. Sorry, I didn't know I have to assign this to myself. Can you tell me if you have already included any of them in your code? And please pardon me for not replying. I came back the same day to reply but I had some connectivity issues at that time so couldn't reply.
Regards,
Rakesh Verma
Comment #8
metzlerd commentedYes, I'd started today, cause I had some time. I'm kind of out of time for a bit so feel free to take this and run with it. It needs refinement, editing and verification. This patch was rolled against 8.2.x. You should definitely start with that and we'll backport after we get it sorted out. If you are interested in sample code, I've been working on a contribution to the examples module which you can find at:
https://github.com/metzlerdl/d8_examples
If you enable this module you can see some examples at examples/fapi_example.
My habit is to make sure I understand each element there before I try and work on the documentation.
Again, let me know if I can be of any help.
Comment #9
rakesh_verma commentedThanks, I just completed my drupal ladder and my proposal for GSoC. I will start working on it by tonight.
Thanks a lot.
Comment #10
ajalan065 commentedGo Testbot
Comment #11
rakesh_verma commentedForm elements miss documentation and code examples.
Comment #12
rakesh_verma commented@metzlerd: Added the example code for language test. Please review.
Comment #13
metzlerd commentedSome procedural feedback: When extending the effort of a patch, the best way forward is to apply the patch, make edits and then submit a patch that includes both sets of work, along with an interdiff that represents the difference between your patch and the one started.
Some specific feedback:
Should include Properties section before here describing any language_select specific properties.
Is this property necessary? If so what does it do?
Comment #14
rakesh_verma commentedGreat piece of advice. Thanks alot. Working on it :)
Comment #15
dagmar@jhodgdon warn me about this issue while I was working on #2710287: Image button properties are not documented.
I did some changes to consistently use
array()instead of[]for arrays. Also we are not using two spaces for example codes.Also removed #value for image buttons since they are not used on those type of elements.
The interdiff is against #8 with the patch #12 applied on top it.
Comment #16
jhodgdonWe should instead consistently use [] instead of array() for arrays. Thanks!
Comment #17
dagmarConsistently using
[]instead ofarray().Comment #18
jhodgdonThanks for taking on this issue dagmar!! The latest patch is looking pretty good.
There are several things that still need to be fixed though:
What is a "datelist" element? We could use a better description of what it does, and how it differs from a Datetime.
Also probably need an @see to the Datetime element.
Formatting:
The - for the list items should line up under the P in Properties. Everything is 2 spaces extra indented.
This last sentence about time zone adjustment is confusing to me, after having read the docs for the #date_timezone property below.
I think one of them is incorrect and they seem to contradict each other?
Looking at where this came from... we've lost the information about which properties are required and which are optional.
The optional ones should be written like this:
This comment also applies to other date/time elements!
i.e. in this sentence is incorrect. This happens a lot in documentation (people confuse i.e. and e.g.). So, we prefer not to use i.e. or e.g. at all -- we had an issue on this recently that cleaned out a bunch of them.
So, instead of "i.e." here, let's say "for example".
Also the punctuation is incorrect. There should be a ; before "for example" and a , after it.
These comments also apply to other date/time elements!
What is a "datetime" element? We could use a better description of what it does, and how it differs from a Datelist.
Also probably need an @see to the Datelist element.
This is not going to format well on api.drupal.org unless it is made into a bullet list (precede each line with - and the lists can be nested).
Also I think it would be better to put these examples after the description of what the properties are. Right here it is a bit confusing. Or better yet, combine it with the Usage example section (maybe make 2 examples). Or ... do we even need this?
Formatting: list elements - should line up under the P in Properties. Everything is indented 2 spaces too much.
See note about timezones from the Datelist element above.
This section is very confusing.
Also the format_date() function is deprecated, and it doesn't have the information that this documentation says to look at.
And how do you use an HTML5 element? Very confusing.
Ah, here's the element. Consider maybe moving this up, since the date format property references this? Would be way less confusing.
Anyway, this may need some more explanation. What is it talking about? I think it should probably be saying "The HTML element used for the date portion" or something like that?
When are these callbacks called? What are their parameters and return values?
See notes on the date_date_element above.
See notes on date_date_format above.
See notes on date_date_callbacks above.
This looks like it was started but not completed?
stray "n"
needs to end in .
what is a control?
what is this trying to say? I don't understand it.
This change is good to make, but not on this issue. This issue is only supposed to be about making documentation for a set list of element types. Can we make a new issue to cover the [] array syntax in other element types?
Same here... and for several others...
This example is confusing. Most of the others have a #type => 'form' line, but this doesn't. It needs to be explained. Or the line needs to be added.
Relative to what? And in the other issue, the usage example you had used "public://filename.png" -- is this also supported?
display -> displayed
Let's leave out the word "form" here.
This element seems to be missing Properties section.
Comment #22
eojthebraveThis isn't actually valid. The Date element requires the default value to be a string in the format yyyy-mm-dd. And, FWIW this is also being addressed in this issue #2836530: Update Date element documentation for #date_date_format and usage for other date types such as time
Comment #28
jhodgdonThis still needs to be done.
Comment #29
jhodgdonUpdating summary.
Comment #38
quietone commentedConverted the MR. Then moved common date propertied to DateElementBase and moved the properties descriptions for methods in Dateitme and Datelist to the class documentation.
Comment #39
smustgrave commentedShouldn't this be broken up some?
Comment #41
smustgrave commentedAppears to need a rebase
Comment #43
sivaji_ganesh_jojodae commentedI've rebased and added some least essential comments in the MR.