Closed (fixed)
Project:
Drupal core
Version:
8.0.x-dev
Component:
node system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
2 Sep 2014 at 22:36 UTC
Updated:
2 May 2015 at 10:44 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
berdirYes it is.
hook_ENTITY_TYPE_prepare_form()
Comment #2
andypostComment #3
gerzenstl commentedIf it's already documented on hook_ENTITY_TYPE_prepare_form(), do we need something else?
I could help.
Comment #4
andypost@gerzenstl it's documented wrong
The proper way is
Implements hook_ENTITY_TYPE_prepare_form() for node entities.Comment #5
andypostComment #6
gerzenstl commentedI thought it was about the documentation of the hook_ENTITY_TYPE_prepare_form().
I fixed the documentation on the implementation of this hook.
Currently is only used on menu_ui and book module. The implementation on datetime module was removed on #2333353
Comment #7
gerzenstl commentedComment #8
andypostPlease add "for node entities" at the end as we use all over core.
PS: try
git grep hook_ENTITY_TYPE_Comment #9
gerzenstl commentedTo find the hook_node_prepare_form() I used (on the root of the drupal code):
fgrep -Hrn --color=always 'hook_node_prepare_form' .But the one you suggest is useful also.
I can add that for all hook_ENTITY_TYPE_* hooks.
Comment #10
pushpinderchauhan commentedThis hook found in book and menu_ui modules, not in datetime. Please review update patch that contains following doc.
+ * Implements hook_ENTITY_TYPE_prepare_form() for node entities.Comment #11
andypost@gerzenstl It would be great to check all
hook_ENTITY_TYPE_*implementations doc blocks and make sure all fixedI've no idea how to grep 'em all but #8 lists 221 lines and most of them points their entity types so manually is fine
Let's file novice follow-up to unify them
Comment #12
gerzenstl commentedI checked all the ENTITY_TYPE hook implementations and added the proper entity on the doc blocks.
Comment #13
BFox commentedComment #14
BFox commentedChecked through all ENTITY_TYPE hook implementations and all appear correct. Marking RBTC.
Comment #16
gerzenstl commentedComment #17
gerzenstl commentedSeems that the testbot tested the patch against a revision with many changes. I created another one and I tested just in case:
$ git reset --hard HEAD
$ git apply --check d8-fix-documentation-hook-entities-implementation-2331783-17.patch
$
It should apply the patch without problem.
Comment #18
gerzenstl commentedComment #19
omessaoudi commentedI will test this
==> Sorry, but the patch doesn't work for me : it does not apply successfully on all modules :
Comment #20
omessaoudi commentedComment #21
nlisgo commentedRe-roll
Comment #22
linl commentedPatch no longer applies.
Comment #23
rpayanmComment #24
andypostLooks good
Comment #25
alexpottThis looks like an incorrect change. hook_entity_type_alter() is a proper hook.
Comment #26
alexpottAlso the scope of the patch and the issue summary / issue title are not aligned - please the issue summary and title.
Comment #27
rpayanmPlease review :)
Comment #28
alexpottThe original documentation is correct. No change is necessary here.
Comment #29
rpayanmComment #30
rgristroph commentedI think #29 correctly addressed the comment from #27, but may have inadvertently included some other stuff in the patch file. I just re-rolled it, attached. I also read through all the changed comments and they look OK, and then I looked for missed places that might need changes with these commands:
grep -r hook_ENTITY_TYPE_ . | grep prepare_form
grep -r hook_ . | grep _prepare_form
I think this patch should pull everything above together.
Comment #31
lakshminp commented#30 documents hook_node_prepare_form() in all places in the core.
Comment #32
alexpottThe patch in #30 also does far more than documenting hook_node_prepare_form(). Either we should remove the out-of-scope changes or re-scope the issue summary and title.
Comment #33
keopxReroll
Comment #34
nlisgo commentedComment #35
rgristroph commentedI looked at the patch in #33 and it seems to include some extraneous changes.
It also looks like some of the places that used to use hook_node_prepare_form() no longer do, for example in block and menu_ui. In fact it seems there is a single call left in code, in the book module. I am attaching a patch which addresses only that.
Comment #36
xanoI have checked the code base and there is indeed only one implementation of
hook_ENTITY_TYPE_prepare_form()in core and the patch from #35 fixes its docblock.Thanks!
Comment #37
rteijeiro commentedI think the correct documentation is
Implements hook_ENTITY_TYPE_prepare_form() for node entities.as @andypost expressed in the IS.Comment #38
jhodgdon#37 is correct.
Comment #39
keopxComment #40
rteijeiro commentedGood!
Comment #41
jhodgdon+1
Comment #42
rteijeiro commentedChanging the title to the right hook.
Comment #43
rteijeiro commentedComment #44
rteijeiro commentedI noticed that it's also wrong for
hook_ENTITY_TYPE_updateincore/modules/ckeditor/ckeditor.modulefile. Is there a issue or should I open a follow-up?Comment #45
jhodgdonNew issue please, thanks! Maybe check to see if there are other spots?
Comment #46
rteijeiro commentedSorry, forgot to post the issue number here: #2472669: Complete documentation for every implementation of hook_ENTITY_TYPE_*
It's also RTBC ;)
Comment #47
webchickLooks like Alex's feedback was addressed.
Committed and pushed to 8.0.x. Thanks!
Comment #48
webchickoops.