Updated: Comment #73
TLDR for Dries: Per @Wim Leers, Dries originally proposed the name edit.module
to replace ipe.module
. However, there is strong consensus, including from numerous community members that edit
is a too-generic and possibly dangerous namespace for a module. We propose quickedit.module
(or @Wim Leers prefers quick_edit.module
). @alexpott has signed off on the rename.
Problem/Motivation
The name edit.module
/"Edit" for our inline editing module is confusing. In the codebase, there is lots of confusion and overlap with the "edit" operation in various contexts, and in many cases it is difficult to tell whether a given bit of PHP, CSS, JS, or markup belongs to edit.module
or something else. For the user (as @jenlampton points out) it makes no sense, because they can already edit things without the module.
Proposed resolution
- Rename the module to
quickedit.module
/"Quick Edit". - The module name is all one word to avoid namespacing conflicts, since
edit
is a very common word that might appear in other hook and function names. - The user-facing label is two human-readable English words.
quick_edit
(with underscore) was originally proposed by @Wim Leers, the component maintainer, in #8, but the current consensus is to make it all one word. Other proposed names that did not reach consensus include:
inline
ipe
(the original name).inline_edit
inplaceeditor
,in_place_editor
, or some variant thereof.
Remaining tasks
- @Wim Leers asked in #70 that Dries approve the module being renamed.
- Patch in #68 has been manually tested for editing the fields of an article on the front page view.
- Incorporate CSS and JS namespace corrections as well, per @Wim Leers in #70.
- Decide whether or not EditEntityAccessCheck and similar should be renamed.
- Decide whether
quickedit
orquick_edit
should be used (see #12, #70, #71). - Thorough manual testing.
- This patch should probably be tested with https://drupal.org/project/fat, which may also need to be updated.
User interface changes
The module name string "Edit" is replaced with "Quick Edit".
API changes
The API changes introduced by this patch have been approved for API freeze (before beta) by @alexpott in #37.
edit.module
is renamed toquickedit.module
.hook_edit_editor_alter()
is renamed tohook_quickedit_editor_alter()
.- All classes and interfaces in the
Drupal\edit
namespace are moved to theDrupal\quickedit
namespace. - The service definitions provided by the module are renamed:
Old New plugin.manager.edit.editor plugin.manager.quickedit.editor access_check.edit.entity_field access_check.quickedit.entity_field access_check.edit.entity access_check.quickedit.entity edit.editor.selector quickedit.editor.selector edit.metadata.generator quickedit.metadata.generator - The module's routes and URI patterns are renamed:
Old route New route Old URI pattern New URI pattern edit_metadata quickedit_metadata edit/metadata quickedit/metadata edit_attachments quickedit_attachments edit/attachments quickedit/attachments edit_field_form quickedit_field_form edit/form/... quickedit/form/... edit_entity_save quickedit_entity_save edit/entity/... quickedit/entity/... - The module's tempstore is renamed from
edit
toquickedit
. - The module's plugin manager cache is renamed from
edit:editor
toquickedit:editor
- The following classes and interfaces are renamed:
Old New EditPluginInterface QuickeditPluginInterface EditController QuickeditController EditFieldForm QuickeditFieldForm EditTestBase QuickeditTestBase EditLoadingTest QuickeditLoadingTest EditIntegrationTest QuickeditIntegrationTest edit_test.module
is similarly renamed toquickedit_test.module
.- The
edit
asset library is renamed toquickedit
,edit.js
is renamed toquickedit.js
, andDrupal.edit
is renamed toDrupal.quickedit
.
Related Issues
- #2047649: Update CSS, JS, and markup names for quickedit.module
- #2047659: Add test coverage for edit module access checkers
- #2047671: Expanded contextual links look goofy when there are no items
Original report by @jenlampton
What about inline module?
People can already edit things in Drupal. I mean, that's probably why they have Drupal in the first place. What they haven't been able to do before now is edit things inline.
(reminded of: Don't Make Me Think: A Common Sense Approach to Web Usability)
Comment | File | Size | Author |
---|---|---|---|
#87 | quickedit-1874640-87.patch | 231.72 KB | Wim Leers |
Comments
Comment #1
mdupont"Inline" is rather vague too. What about "Inline editing" or "In-place editing" which are more descriptive of what the module does?
Comment #2
Bojhan CreditAttribution: Bojhan commentedInline editing - would be good. I don't think "In-place" has any meaning?
Comment #3
Wim LeersOriginally, this was called
ipe.module
, the human-readable name being "In-Place Editing". But, as implied on the project page, it was renamed to "Edit" to not conflict/confuse people with Panels' pre-existing "Panels IPE" functionality.Comment #4
quicksketchThat may have been a reasonable justification for Drupal 7, but as a Drupal core project, core should use the most logical namespace and contrib should adjust. I remember we had the same discusion about what to do because we needed a name for the Image module. Of course there was a contrib project named Image already. Though the contrib Image module was dying already, I don't think anyone regretted that core got the proper namespace. Panels IPE and IPE aren't in direct conflict anyway.
However, even with that whole argument, I don't think IPE is a good name anyway. It would be preferable to avoid obscure acronyms that require people either open the .info file or Google it.
I'm also a proponent of "Inline editing" module, using "inline" for the machine name. The current project Inline would be better named as "Inline filter" IMO anyway. We should probably ask @sun about this, since it's one of his modules.
Comment #5
Wim Leers#4: the machine name would have been "ipe", as in
ipe.module
; the human-readable name would have been "In-place editing". That is pretty much the same as what you propose: "(Inline|In-Place) Editing" as human-readable name,(inline|ipe)
as module name. Note that the Inline module is moving away from being a filter (but that's a whole other story), so it will likely be inappropriate to rename it to "Inline Filter".I agree that "Panels IPE" and "In-Place Editing" could hardly be considered conflicting names, but that's the way it went.
Your point about acronyms (which is against "IPE") is a good one, though I very much like the brevity (of "IPE").
Personally, I don't have strong feelings about this. I also don't think we should spending our energy on this right now. I propose to postpone this until after Feb 18; unless strong consensus is reached here and there are solid reasons to do it sooner.
Comment #6
tim.plunkettI would like to see inline_edit.module. That way it doesn't squat on http://drupal.org/project/inline, which does something entirely different, or ipe.module from Panels.
This has become even more confusing with the addition of editor.module
Comment #7
jenlamptonI'd be happy with inline_edit.module, as long as the human-readable name for it (the one that shows in UIs) is a noun. I think very other module name is a noun. How about "inline_edit" and "Inline Editor"?
Comment #8
Wim LeersIn the UI it is called "Quick Edit". So I'd definitely prefer quick_edit over inline_edit. Even more so because we've standardized on "In-place" editing, not "Inline" editing.
Also: AFAIK there's a strong preference for 1-word module names (i.e. no underscores). Neither makes that possible.
Overall, I still prefer "ipe": an abbreviation for "in-place editing" (also see #5).
Comment #9
quicksketchSo over in #1987140: Add a dedicated @InPlaceEditor plugin annotation, it's shaping up that our annotation namespace is going to be @InPlaceEditor, which is descriptive and accurate. With the reduction of procedural code, longer module names aren't as inconvenient as they were previously. Edit currently only contains 10 procedural functions in the whole module. And now that the module name is no longer repeated in the plugin namespaces (and likely to be removed from the /lib directories when the dust settles in #1971198: [policy] Drupal and PSR-0/PSR-4 Class Loading), the module name being used anywhere other than in the namespaces and file names is becoming a rarity.
Basically all of that is to say we should probably not use an acronym. Unfortunately if we used underscores to match the camel-casing, this would end up being "in_place_editor", which is an awkward use of underscores. How about "inplace_editor"?
@WimLeers if you're really strongly in favor of ipe, that's still an improvement in my mind. I just don't see short module names as much a necessity in D8.
Comment #10
Wim Leers#1987140: Add a dedicated @InPlaceEditor plugin annotation brings us
\Drupal\edit\Annotation\InPlaceEditor
. Which meanshook_edit_editor_alter()
should probably be renamed tohook_edit_inplaceeditor_alter()
(thanks to @tim.plunkett for pointing that out!). But at the same time, edit.module might be renamed here. So let's do that in one patch here.Comment #11
PanchoSomething like 'inplaceeditor' would be okay. It should probably be 'in_place_editor' though, even though that's a bit bulky. 'inplace_editor' seems inconsistent and therefore slightly error-prone.
So maybe Wim's proposal 'quick_edit', which I liked very much, remains an alternative, if we also expose it to the UI. It seems even preferable to suggest that this is meant to be only for quick edits, not a full replacment of the edit page.
However, all of these are better than the current name 'edit'. I just want to stress the DX (and partly even UI) importance of the filesystem name matching the UI name. It's really confusing otherwise.
Note that we'd might also want to rename the module currently simply called 'editor' (UI: Text Editor), making the differences a bit clearer, possibly 'rich_text_editor' or 'text_editor'.
Comment #12
xjmI like the idea of making it simply
quick_edit.module
, so long as there aren't anyhook_edit*()
ortheme_edit*()
out there that we have to worry about colliding with... There didn't seem to be, searching api.d.o and drupalcontrib.org, at least. Still, maybequickedit
(as one word) would be safer?Comment #13
tim.plunkettquickedit
+1Lets please just do this
Comment #14
jibranAlso +1 to
quickedit
.Comment #15
PanchoOne more +1 to
quickedit
. It's distinct, obvious and nice.Comment #16
xjmIncoming!
Comment #17
xjmFirst pass. I deliberately did not rename PHP or JS classes, interfaces, or methods. I also left some instances of
foo.edit
in the JS that looked to be something other than the module's namespace, but I don't know enough about JS to be positive.Please review carefully.
Comment #18
xjmProtip:
git diff --color-words --staged
Comment #20
xjmMmm. There also needs to be a change made in standard profile, at least.
Comment #22
xjmComment #26
xjmYeah, #22 is broken when testing manually. Maybe let's just start with the module itself and its PHP namespace.
Comment #27
xjmAlright, so the attached is at least functional for quick-editing the body of an article. No interdiff because it's a new patch. It changes:
The fact that this is a royal pain in the backside to roll is another good reason to make this change.
Comment #29
PanchoCumbersome task, but as said in #27 that's another good reason to make it distinguishable.
Besides: Should the user-facing name be 'Quick Edit' or 'Quickedit'? Slightly preferring the latter, so it maps 1:1 to the machine-name, but in the end I don't care much.
Comment #30
xjmWe shouldn't map user-facing strings to machine names.
Comment #31
xjmRe: the fails above: currently, stuff isn't getting attached to the page in
EditController::attachments()
because some dependency check is failing indrupal_process_attached()
.Attached also doesn't resolve the issue.
Comment #32
xjmThis too.
Comment #33
xjmAha. This still fails, but later. The dependency check works at least.
Comment #35
xjmHere we go. Missed updating the form callback name, which
EditController
uses directly withdrupal_build_form()
. We'll want to fix that at some point. I think @tim.plunkett might already have an issue for it.I also changed the route names so that they're namespaced correctly while I was at it.
Manually tested--updating an article body works, with widget and everything. Yay.
Comment #36
xjmOh. Yeah. I haven't changed the class/interface/method names, but this still involves renaming callbacks, routes, services, and such, not to mention the module itself.
Comment #37
alexpottAs the edit module is entirely new to Drupal core I think this is an acceptable post API freeze change as long as this is before beta releases.
With regards to the change - I agree that edit is a bad name for a core module (well any module) and quickedit is better
Comment #37.0
alexpottadded why
Comment #37.1
xjmUpdated issue summary.
Comment #37.2
xjmUpdated issue summary.
Comment #37.3
xjmUpdated issue summary.
Comment #37.4
xjmUpdated issue summary.
Comment #37.5
xjmUpdated issue summary.
Comment #37.6
xjmUpdated issue summary.
Comment #37.7
xjmUpdated issue summary.
Comment #38
xjmRe-namespacing the CSS classes is another whole can of worms, because the prefix
edit-
is used all over the place, and it's going to be just fabulous to untangle that and find out what is specifically related to this module. For the following reasons, I think we should defer updating the CSS classes to a followup:Same probably goes for the JS API. At least, I'd want @Wim Leers to review the JS changes himself, and he will be on vacation for the next two weeks.
Meanwhile, I'm going to take a crack at renaming the PHP classes, interfaces, and methods now.
Comment #39
xjmAttach renames the following classes and interfaces:
Note there were some existing documentation bugs where
Editor*
was referred to asEditPlugin*
, but fortunately most of them can just be replaced with{@inhertidoc}
anyway.I started to rename the EditEntityAccessCheck* family, but then looking at the code, it looks like these might refer generically to permission for editing entities and fields, rather than to quickedit specifically. So, I've left them for now.
More later.
Comment #39.0
xjmUpdated issue summary.
Comment #40
quicksketchGreat work xjm! Thanks for undertaking this. Another +1 for "quickedit".
Comment #41
amateescu CreditAttribution: amateescu commentedIf we want to go with 'quickedit' and not 'quick_edit', than those class names are not correct, they should be QuickeditPluginInterface and QuickeditController..
Comment #42
nod_@xjm, I can review JS changes if you need before Wim comes back.
Comment #43
xjmI was hoping no one would notice that. ;)
Comment #44
xjmChanging
QuickEdit
toQuickedit
. :PComment #44.0
xjmUpdated issue summary.
Comment #45
xjmThe rest of the class renames, unless we also want to rename EditEntityAccessCheck and friends.
Comment #46
xjmderp.
Comment #46.0
xjmUpdated issue summary.
Comment #47
xjmmkay, going to rename the URLs next:
Comment #48
xjmComment #48.0
xjmUpdated issue summary.
Comment #48.1
xjmUpdated issue summary.
Comment #48.2
xjmUpdated issue summary.
Comment #49
xjmAlso renaming the
quickedit_test
helper module.Comment #49.0
xjmUpdated issue summary.
Comment #50
xjmTook a stab at renaming the asset library and thence
Drupal.edit
.Astonishingly, it still seems to work when I test it manually.Actually, I somehow reverted my patch on my local install. It's broken. Should have sacrificed that chicken!Edit: A few comments will need to be rewrapped.
Comment #51
xjmThat interdiff is a lie. This is the real one.
Comment #51.0
xjmUpdated issue summary.
Comment #52
xjmOops.
Comment #53
xjmComment #54
xjmNote to self: update MAINTAINERS.txt in the next patch as well.
Comment #56
xjmI used firebug today! I'm very proud of myself.
Which leads me to:
...and changing the latter two makes it work! I totally just debugged JS.
Attached fixes that, and also fixes the test failure (which was unrelated).
Comment #57
xjmSo it occurred to me that I've only been testing as user 1, and not as any user with restricted permissions. I checked and the access checkers are not unit tested, nor is there test coverage for a user who has permission to use Quick Edit, but not to update a particular entity and/or field.
I tested manually by creating a user on a standard install that had permission to access contextual links, quick edit, etc. but no permission to edit articles. The Quick Edit link was correctly not shown. I did discover an unrelated bug, though. This is what happens when you have contextual links with no options:
This is what happens when you visit
quickedit/entity/node/1
directly as a privileged user:As an unprivileged user (who can use Quick Edit but not edit articles), it properly gives access denied. So that's good, at least.
I didn't test per-field access or any entity access more sophisticated than toggling "edit any article content".
Comment #58
nod_patch changes JS files.
Reviewed the JS, should we change the theme functions name as well? currently we have a bunch of:
Drupal.theme.editFormContainer
Drupal.theme.editBackstage
shouldn't that beDrupal.theme.quickeditFormContainer
Drupal.theme.quickeditBackstage
. Same for an id used in some ajax mess:edit-load-editors
toquickedit-load-editors
as well as the JS event name and more importantly the name of data- attributes which are stilldata-edit-id
?Comment #59
xjmAnything inside a
*.js
file is incomprehensible to me, so: If you say so? :) I didn't know what thedata-
business was, so I didn't change it. Googling, there are a lot of hits in things that aren'tedit.module
for attributes calleddata-edit-id
, so I don't know if it's some standard thing?Similarly, I had no way if those JS method names were related to the module namespace or not. They're all confined to the quickedit directory, OK, but some seem to correspond to IDs and classes that haven't been renamed yet, so maybe it would make more sense to do those along with the CSS? I can't tell how they're called, and I also don't know enough to recognize when they're being used as callbacks. E.g., I'm guessing the following would need to be changed as well:
(Both these things are reasons that it's really important to do this module rename. Also, I'm really wishing we had the automated frontend testing integrated into our testing infrastructure about now...)
Comment #60
xjm(Edited to just list filenames.)
So I guess those are safe for me to change, if we're OK from them diverging from class/ID names for the time being.
Comment #61
nod_umm ok, let's do it in a follow-up if that's still possible at this point in time. There is loads of JS and like you said, some of it is tied to the CSS.
Comment #62
xjmAttached changes those method names, but this line makes me nervous:
I didn't see that anywhere else... is
Drupal.theme.prototype
a magic thing?Also, I guess this is the "event name" you're referring to? The
foo.edit
stuff I was afraid to touch?I'm definitely not qualified to make those changes.
Comment #63
xjmCrossposted with #61. Phew. :) I'll revert #62 in the next patch.
Comment #65
xjmAttached finishes off the PHP-facing parts by renaming the CSS and JS files.
Remaining tasks:
Comment #65.0
xjmUpdated issue summary.
Comment #65.1
xjmUpdated issue summary.
Comment #65.2
xjmUpdated issue summary.
Comment #65.3
xjmUpdated issue summary.
Comment #65.4
xjmUpdated issue summary.
Comment #66
xjmFIled followups:
Let's get some code review and manual testing, please. :) Also, feedback about the access checkers (see summary and #39).
Comment #66.0
xjmUpdated issue summary.
Comment #67
xjmThese are some comments that need rewrapping.
Comment #68
xjmComment #68.0
xjmUpdated issue summary.
Comment #69
Wim LeersComment #70
Wim LeersNeed work for 1) "quick_edit" should be the name for consistency, 2) all the changes should happen in one patch.
Comment #71
xjmThanks @Wim Leers!
The problem with this is that it causes namespace conflicts, e.g. like there has been
admin_menu()
. The word "edit" in particular is a danger. Fortunately, it's now an easy string replace for the changes in there either way.I'm not capable of making the JS changes because I can't tell what's API and what's language keywords or whatever, so someone else will need to pick that up very soon if we want to get this in.
Comment #72
xjmI used the name that you, as the component maintainer, suggested yourself, one that had a lot of consensus, and that's usually sufficient. Generally we only escalate to Dries in case of a disagreement. I did not know that Dries proposed the original name, and I also did speak to a core maintainer (@alexpott).
Comment #72.0
xjmUpdated issue summary.
Comment #73
xjmLet's try to get some more feedback on
quickedit
vs.quick_edit
. I'll replace with that name if there is consensus that I'm overestimating the risk of namespace collisions, but as someone who has been bitten by these problems in the past (just look at the contrib modules I maintain), I personally think that a slightly less "consistent" (but still entirely legible) name is a small price to pay for ensuring that doesn't happen. ;)Meanwhile, re-incorporating the patch from #2047649: Update CSS, JS, and markup names for quickedit.module.
Comment #75
xjmOops, sorry, I missed that @Wim Leers asked that we still get approval from Dries on the name.
Comment #75.0
xjmUpdated issue summary.
Comment #75.1
xjmUpdated issue summary.
Comment #75.2
xjmUpdated issue summary.
Comment #75.3
xjmUpdated issue summary.
Comment #75.4
xjmUpdated issue summary.
Comment #75.5
xjmUpdated issue summary.
Comment #75.6
xjmUpdated issue summary.
Comment #76
tstoecklerI'm totally for quick_edit over quickedit. Namespace collisions are a general problem that we failed to fix in D8 and should not block this. There's nothing specific that currently collides. If there's a quick.module in contrib or something, it will just have to be careful.
Comment #77
Dries CreditAttribution: Dries commentedThanks for looping me -- I care about naming. In this case, I'm ok with renaming the edit module to quickedit. I'd prefer quickedit over quick_edit.
Comment #78
jessebeach CreditAttribution: jessebeach commentedI can't get the patch in #73 to apply at all. I tried applying to a commit to 8.x from 7 days ago, but that didn't work. I think someone who perhaps has a local branch with this patch applied will need to rebase that branch and bring it up to the current 8.x HEAD. The
--reject
version of apply is just to messy at this point for me to understand how to fix it.Comment #78.0
jessebeach CreditAttribution: jessebeach commentedUpdated issue summary.
Comment #79
jibran73: quickedit-1874640-72.patch queued for re-testing.
Comment #81
xjmComment #82
Wim LeersThe Edit module has stabilized in early Q1 2014.
For more than two months now, edit.module has had the same set of ~15 issues. Therefore, if we are to ever do this rename, this is the time: when few patches get broken and beta is peeking around the corner.
We have Dries' approval in #77.
If the core committers give the sign, I'll work on the patch to rename
edit
toquickedit
module. Tentatively adding the "beta blocker" tag.Comment #83
xjmMore of a beta target, I think, but let's do it!
Comment #84
xjm@Wim Leers said he can tackle this which makes a lot more sense than me doing it since he wrote the module. :)
Comment #85
Wim LeersEt voilà!
Comment #87
Wim LeersI failed at creating a patch. Here's the proper one.
Comment #88
Wim LeersStupid!
Comment #90
xjm87: quickedit-1874640-87.patch queued for re-testing.
#2240709: ConfigImportUITest::testImport fails when the module list changes
Comment #91
xjmSo per more recent chat shenanigans, #2240709: ConfigImportUITest::testImport fails when the module list changes is actually a hard blocker for this (and the test does fail locally with this patch as well).
Comment #93
xjm87: quickedit-1874640-87.patch queued for re-testing.
The blocker #2240709: ConfigImportUITest::testImport fails when the module list changes landed, so retesting again. Yay!
Comment #94
tim.plunkettI reviewed this locally by replacing all of "quickedit" "Quick Edit" etc with "edit" (which was a much easier task than I'm sure this was for you!)
The only remaining changes were doc block additions, line re-wrapping, and stale use statement deletions.
Looks good!
Comment #95
xjmNudging priority.
Comment #96
alexpottCommitted 240392c and pushed to 8.x. Thanks!
Comment #98
xjmAdded a change record and updated:
https://drupal.org/node/2164623
https://drupal.org/node/1872284
https://drupal.org/node/2186583
Comment #99
Wim Leers#98: thanks! :)