Problem/Motivation
The doc blocks for configureEntityFormDisplay() and configureEntityViewDisplay() are inaccurate.
Originally, there was just one method, configureEntityDisplays(). In #2446511: Add a "preconfigured field options" concept in Field UI this was split up into two methods, and the original doc block was copied for both. The parameter comments were updated, but the first line of the doc block still reads
* Configures the newly created field for the default view and form modes.
even though one of the new functions handles view modes and the other handles form modes.
Proposed resolution
Update the doc blocks to describe accurately what each method does.
Remaining tasks
Update the doc blocks. (done)
- Apply the patch and make sure that it applies correctly.
User interface changes
None
API changes
None
Data model changes
None
Comments
Comment #2
semiuniversal commentedI'll take a look at this.
Comment #3
benjifisherComment #4
semiuniversal commentedOK, here's a patch that edits the 2 doc blocks.
I noticed that not only was the method split up into 2 methods, but that it was used for both newly-created and existing fields. Therefore I and removed the "newly created" language from the documentation.
Comment #5
semiuniversal commentedOops, I uploaded the wrong patch file. Here's the right one.
Comment #6
mirie commentedComment #7
mirie commentedDoc comment changes in patch (update_doc_blocks_for-2847685-5.patch) look good to me!
Comment #8
mirie commentedComment #9
benjifisherGood point about removing "newly created" from the doc comments. The lines
appear twice in
submitForm(): once for newly created fields, once for reused fields.Comment #10
xjmComment #12
cilefen commentedUpdating issue credit.
Comment #15
cilefen commentedI reverted this because when the patch applies, the comments are applied to the wrong respective functions. Yes, I'm serious.
Comment #16
benjifisherWow, I have never seen that happen before. I tried it myself, using the current HEAD of the 8.4.x branch, and this is what happened:
I guess when
git(orpatch) looks at the first hunk, it prefers an offset of +6 to one of -12, and it is not smart enough to look ahead at the second hunk.It should be pretty easy to re-do the patch, so I will add the "Novice" tag.
To make sure we do not get the same problem, let's study the available options for
git diff... I think this will work:to provide 6 lines of context instead of the default 3.
For reference, other options we could use include
--inter-hunk-context=12or--function-context(short form-W).Comment #17
tameeshb commentedTried with
Comment #18
tameeshb commentedApplied to a new branch and verified.
Comment #19
benjifisher@tameeshb, thanks for updating the patch!
I think this is still a novice task.
Comment #20
benjifisherFixing the tag ...
Comment #21
ohthehugemanatee commentedTested. Patch applies cleanly, docblocks are on the right functions.
Comment #24
cilefen commentedCommitted 9bdb51c and pushed to 8.4.x. Backported to 8.3.x as d444aad because docs improvements are allowed in patch releases. Thanks!