Closed (fixed)
Project:
Drupal core
Version:
8.0.x-dev
Component:
documentation
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
15 Apr 2015 at 13:51 UTC
Updated:
22 Mar 2016 at 23:34 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
jhodgdonGood idea... Any thoughts on what to say for the overview though? There's already a list of what handlers exist on the Entity API page, and I don't think it's all that useful to say "they do stuff" or "they provide all sorts of functionality'. It's really kind of a meaningless term that we've invented to mean "a bunch of other classes that separate out the basic functionality of entities into different pieces".
So rather than actually defining what a 'handler' is, I think it might be sufficient to just change where it says:
The annotation will refer to several controller classes, which you will also need to define:
in the Entity API topic, to instead say:
The annotation will refer to several "handler" classes, which you will also need to define:
My suggestion for EntityHandlerInterface and EntityHandlerBase is that we just add a line saying
@ingroup entity_api
which will refer people to the topic if they are wondering what these are about.
Comment #2
xjmComment #3
joyceg commentedComment #4
joyceg commentedWhere can I find the Entity API documentation?
Comment #5
tim.plunketthttps://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Entity%21...
http://cgit.drupalcode.org/drupal/tree/core/lib/Drupal/Core/Entity/entit...
Comment #6
harings_rob commentedComment #7
harings_rob commentedHello,
I've included a patch with the changes as suggested by @jhodgdon.
This is only a documentation update.
Regards,
Comment #8
Anonymous (not verified) commentedAdded beta eval.
Comment #9
Anonymous (not verified) commentedThis indentation is not correct. Comment lines should be wrapped as close to 80 chars as possible.
Comment #10
harings_rob commentedFixed the indentation to fill as many characters as possible.
Comment #11
strykaizerTag fix
Comment #12
jhodgdonNot everything in the issue summary under Proposed Resolution is taken care of, I think?
Comment #13
katewelling commentedI am going to have a look at proposal 1
Comment #14
katewelling commentedComment #15
katewelling commentedI am going to have a look at issue 1
Comment #16
danylevskyiI'm a mentor. Helping @katewelling to work on the issue.
Comment #17
danylevskyiComment #18
klopez commentedPicking this up for catalyst academy. This will be my very first patch
Comment #19
klopez commentedIn Entity API documentation topic, changed "controller" to "handler" in translation section under Defining an entity type. That should cover the first proposed resolution. Second resolution was already included as part of previous patch with the suggestion
@ingroup entity_apifrom @jhodgdon. I have usedgrep -nrI "* .*controller" *to search for any other instances of controller in the files, which there were none except those referring to routing controllers. Please review, this is my very first patch on drupal.Comment #20
jhodgdonNice work, thanks!
I also grepped for "controller" in Core and saw several additional places that also need to be fixed:
a)
This should be handlers['storage']
b)
This is referring to an entity storage *handler*
c)
storage *handler*
d) This one is a bit tricky. In entity.api.php (in the Entity API topic), in the routing section, there are actually some references to controllers that should be handler. Where it says:
In this passage, everywhere it says "controller" it should say "handler".
e) Two base/generic handler classes have docs headers that still call themselves "controllers":
- EntityListController
- EntityViewController
f) Several specific entity handler classes have docs headers that still call themselves "storage controllers" or "form controllers" or something similar:
- CommentStorage
- CommentTypeForm
- CommentViewBuilder
- CommentForm
- ProfileForm (in user module)
- RegisterForm (in user module)
- NodeStorage
- NodeForm
- NodeViewBuilder [should say it is a view builder handler not a render controller]
- NodeGrantDatabaseStorage
- NodeTypeForm
- ShortcutForm
- ShortcutSetForm
- FeedViewBuilder (in aggregator module)
- FeedForm (aggregator)
- ItemViewBuilder (aggregator)
- BlockContentViewBuilder [should say it is a view builder handler not a render controller]
- BlockContentForm
- TermViewBuilder (taxonomy module) [should say it is a view builder handler not a render controller]
- TermForm (taxonomy module)
- VocabularyStorage (taxonomy)
g)
These also seem to be referring to entity storage handlers
h)
... class name for list handler...
i)
The first one should be talking about a views data handler; the second is an entity storage handler.
j) Several spots in core/modules/field_ui/src/EntityDisplayModeListBuilder.php in the isValidEntity method doc block. These are all referring to entity view builder handlers, not route controllers.
k) The EntityFormModeListBuilder class has the same problem as (f).
Comment #21
klopez commentedComment #22
klopez commentedHopefully everything @jhodgdon mentioned has been addressed in this patch. And thank you @jhodgdon for your extensive and descriptive comment
Comment #23
jhodgdonThanks! Looking at the interdiff, it looks like everything was taken care of except:
e) EntityViewController... but yeah actually that *is* a controller. My bad!
So... Could you please make one more pass through this patch, and make sure things that are view builder handlers are all called that? Some places, they are called "render handlers" still. Let's make them a bit more uniform, if possible. Same with storage handlers, sometimes the word "storage" is missing from the description.
And a few lines need to be rewrapped closer to 80 characters after changing wording.
I need to run, sorry... hope that is enough detail!
Comment #24
klopez commentedComment #25
klopez commentedAnother go at it, thanks @jhodgdon for the comments
Comment #26
klopez commentedComment #27
klopez commentedComment #28
klopez commentedFound a wrapping issue in my last patch, should be fixed here
Comment #29
jhodgdonThanks for the new patches! This looks good except for a few things (mostly one error repeated several times, see below).
Oops. The class name here is still EntityController, so we shouldn't change this line.
This one is actually a routing controller, not an entity handler. So let's not make any change to this doc block. Sorry for the misdirection in my earlier review!
Whoops. Sorry I wasn't clear in my too-quick-gotta-run comment previously!
There are several types of handlers:
- Entity storage handlers
- Entity form handlers
- View builder handlers
- List handlers
etc.
Not all of them are "storage" handlers, just the entity storage handlers themselves.
So this one should just say "Form handler" not "Form storage handler". [Note: in comments below I've just said something like "Form handler (not storage)" to indicate other places where this change is needed.]
Form handler (not storage)
How about:
Base handler for comment forms.
Looking at the code for this method (isValidEntity()), it does this:
Then the EntityType::hasFormClass() method does this:
So it appears it is filtering based on the presence of form handlers, not storage handlers. I suggest:
Filters entities based on their form handlers.
Form handler (not storage)
Form handler (not storage)
Form handler (not storage)
Form handler (not storage)
Form handler (not storage)
Form handler (not storage)
Form handler (not storage)
Comment #30
snehi commentedDone.
Comment #31
jhodgdonThis error is not introduced by this patch... but maybe we can fix it here anyway.
This doc block was apparently copy/pasted from another class, probably in User module.
But anyway... This is actually the form handler for comment type edit forms. Not "category" edit forms.
Everything else looks great in this patch. So to save time, I edited this one line in the patch to say "Base form handler for comment edit forms", and took the liberty of marking it RTBC.
Comment #32
alexpottThis is about config and not entities - out-of scope. Config storage documentation should get its own issue.
This is an out-of-scope change
I think this change is incorrect - this needs more investigation. See FieldConfigListController and EntityListController - these are controllers and not entity handlers. Also I can't see how the
list_controlleris actually used. I think it is defunct and should be removed - in a separate issue.This is not about entity storage it is about config storage again... Also imo both handler and object are unnecessary. But I think it is out-of-scope to this issue.
Comment #33
a_thakur commentedThe patch does not apply to the current HEAD..candidate for reroll
Comment #34
shashikant_chauhan commentedI am working in this issue.
Comment #35
shashikant_chauhan commentedUpdated the patch based on alexpott suggestion.
Comment #36
shashikant_chauhan commentedComment #37
snehi commented@shashi please upload interdiff in case of new patch with respect to old one.
Thanks for your contribution.
Comment #38
jhodgdonI'll review this once there is an interdiff file, thanks.
Comment #39
shashikant_chauhan commentedI am unable to create interdiff file for it.
Getting message
This is what I got while creating interdiff from patch #31 and #35
and
Kindly let me know how to create interdiff in this case.
Comment #40
shashikant_chauhan commentedComment #41
jhodgdonThanks for trying on the interdiff file -- yes, they can sometimes be tricky, especially when some files are in one patch and not in the other.
Anyway... reviewed the patch. It's looking pretty good, and and the review in #32 was addressed, so thanks! But I found a few more problems that still need to be fixed:
Hm. I guess this is part of the Field API not the Entity API so, along the lines of comment #32, this change is out of scope for this issue and should be removed.
This should say "for aggregator feeds" ...
... because this is the class that handles aggregator feed *items*.
This is actually the handler for comment *type* edit forms, not comment edit forms.
builder is misspelled here.
form -> form mode
Comment #42
shashikant_chauhan commentedAdded suggestions.
Comment #43
jhodgdonThanks for the new patch! We're getting closer, but it still needs a bit of work:
Sorry, I guess I wasn't clear in my last review. Just "aggregator feeds" here. This entity is for entire feeds, not items within a feed.
And then here:
This one should say "for aggregator feed items", because this entity is for the items within a feed. Not "feeds items".
And ... now there is a new problem introduced in this patch:
You've rewrapped this part of the documentation, but it's not wrapped correctly now.
A few problems:
a) Classes with namespaces -- the namespace should start with \ always.
b) The whole thing, including the last two lines, needs to be wrapped as a single paragraph. Or if you think that the sentence starting See ... in the last two lines belongs in a separate paragraph, then you need to leave a blank line between the previous paragraph and this paragraph... personally I think it is all meant to be one paragraph so it needs to be wrapped as one paragraph.
Comment #44
shashikant_chauhan commentedSorry, misinterpreted. Added new suggestions.
Comment #45
jhodgdonNo, still not right.
Again...
Please rewrap these two lines so that they go out to nearly 80 characters without going over.
Also please make sure that the class namespace starts with \ in the second line.
Thanks!
Please see previous review. Still not fixed.
This should say:
... for aggregator feeds.
NOT feeds items.
Comment #46
shashikant_chauhan commentedThanks, Added suggestions.
Comment #47
jhodgdonThanks! It all looks right now.
Comment #48
catchComment #49
catchCommitted/pushed to all three 8.x branches, thanks!