Closed (fixed)
Project:
Drupal core
Version:
8.0.x-dev
Component:
edit.module
Priority:
Normal
Category:
Task
Assigned:
Issue tags:
Reporter:
Created:
5 May 2013 at 13:02 UTC
Updated:
29 Jul 2014 at 22:16 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
damiankloip commentedComment #2
damiankloip commentedComment #4
damiankloip commentededit-editor-annotation.patch queued for re-testing.
Comment #6
damiankloip commentedEditor name conflict. Maybe the editor modules Editor class can be PropertyEditor instead (based on the class description)?
Comment #7
wim leersBetter:
InPlaceEditor.Also, why do we have namespaces if we can't leverage that anyway? One of the big points of namespaces is precisely that you shouldn't have to worry about classes with the same name… but my guess is that the plugin system doesn't support namespaces?
Comment #8
wim leersUpon further consideration — I don't think I understand what name conflict there is?
Comment #9
dawehnerWell, the problem is that you can't have the same classname twice in a context of a class. You can't change the "active" class (as that's what you add in the file) so the other class (the annotation) need to be different.
maybe we should rename the id as well?
Comment #10
wim leersSorry, I didn't see you already had done that rename.
I meant that Edit's "Editors" in general could potentially be renamed to "InPlaceEditors".
But this:
makes no sense, unfortunately.
I now also understand what you were saying in #6: you have to
use Drupal\edit\Annotation\Editor;, but the class in which this is used is already calledEditor:) Now THAT makes sense!The solution is simple though:
use My\Full\Classname as Another;, i.e.use Drupal\edit\Annotation\Editor as InPlaceEditor. Or doesn't the whole "plugin system annotation thing" allow for aliasing@Editorto@InPlaceEditor?If that's the case, then I'd rename
\Drupal\edit\Annotation\Editorto\Drupal\edit\Annotation\InPlaceEditor. The funny thing is that I originally advocated for something like that, but reviewers said something like "we have namespaces, so why would we want to include qualifiers that we don't need — let's just call it 'editor'"…Comment #11
damiankloip commentedYeah, you can't do that. So not simple, unfortunately.. If we use as InPlaceEditor then the annotation will have to be @inPlaceEditor, which then breaks the whole consistency of having plugin specific annotations.
Your comment in #10 contradicts itself slightly :) Would you prefer the annotation to be renamed to InPlaceEditor or the actual Editor class that I renamed to PropertyEditor (which was kind of a guess)?
Here is a patch that renames the Editor plugin class to InPlaceEditor, as this seems like the best choice to me. I'm happy to reroll if you disagree though.
Comment #13
tim.plunkettTagging.
Comment #14
damiankloip commentedWhoooops.
Comment #16
damiankloip commented#14: 1987140-14.patch queued for re-testing.
Doesn't seem related ...
Comment #17
dawehnerJust in general it feels wrong to have camel-case names for this properties.
Comment #18
dawehnerI guess we should rerole the patch on #1987298: Shorten directory structure and PSR-0 namespacing for plugins
Comment #19
quicksketchHey guys, we absolutely should not be using the Editor namespace here. We need that for the editor.module's declaration of editor plugins such as CKEditor.
There wasn't a separate issue for it yet, so I opened it at #1992744: Add a dedicated @Editor plugin annotation.
For this issue I'd be happy to see InPlaceEditor be the defined namespace, and then work on #1874640: Rename edit module to quickedit as a follow-up.
Comment #20
damiankloip commentedSounds fine, thanks for the clarification. Anything that gets us out of naming hell between these modules :)
I'll reroll.
Comment #21
damiankloip commentedSo something like this?
Comment #23
quicksketchThis should be InPlaceEditor.php
To further help the namespacing problems we've got with Edit and Editor module, would it be sensible to rename this class to something like Default.php? So it would be core/modules/editor/lib/Drupal/editor/Plugin/InPlaceEditor/Default.php? I mean, I doubt there are going to be too many alternative in-place editors written, but still, the phrase "default in-place editor" makes a lot more sense than "the editor in-place editor".Sorry I thought this plugin was provided by Edit module. It makes sense as-is. Of course the Editor module should be responsible for the Editor in-place editor. Unfortunately named yes, but it makes sense.
Comment #24
quicksketchOh geez, I just realized that in #1886566: Make WYSIWYG editors available for in-place editing, we created a property called "supports_inline_editing". What a mess. I suppose the followup we can name this to "supports_in_place_editing"? I really wish "inplace" where just a single word, or that "inline" was simply acceptable to everyone. Any opinions on this @damiankloip?
Comment #25
damiankloip commentedHehe, I knew I missed something silly.
Just for future reference, default is a reserved word in php (i.e. in a switch), so you can't have classes named 'Default' unfortunately.
Hmm, it's tricky. I would say that in place is a much better term for describing what it is, there is less ambiguity IMO. However, I also agree that inline is good because it is a single word - I'm not sure inplace works unfortunately. Otherwise I would agree it would be the way to go. So, yes, I think there should be a follow up to change use of inline.
Here is a reroll with the file rename.
Comment #27
damiankloip commentedOver zealous on the manager name change...
Comment #28
wim leers#1979784: Factor Create.js and VIE.js out of the Edit module got committed yesterday, which means #27 will no longer apply.
s/Editor/InPlaceEditor/
This is gone as of #1979784: Factor Create.js and VIE.js out of the Edit module.
s/editor/in-place editor/
Undo this change, see next comment.
No, this should be 'editor', not 'in_place_editor'. It refers to editor.module's in-place editor.
Comment #29
wim leers.
Comment #30
damiankloip commentedTired reroll...
Comment #32
damiankloip commentedComment #33
wim leersDown to mere nitpicks, then this'll be RTBC. Sorry :/
s/in-place-editors/in-place editors/
… or is that actually against English grammar? I'm not a native speaker, you are AFAICT :)
s/editor/in-place editor/
s/editor/in-place editor/
Comment #34
damiankloip commentedLet's get this done! :)
Comment #35
dawehnerWims feedback got adressed
Comment #36
wim leersThanks :) And sorry for all the nitpicking! :(
RTBC +1
Comment #37
alexpottNeeds reroll
Comment #38
damiankloip commentedRerolled.
Comment #39
wim leersRTBC if comes back green.
Comment #40
alexpottCommitted 93e8015 and pushed to 8.x. Thanks!
Comment #41
wim leers.