This module requires a greater eye toward existing vocabularies - notably, it uses the term "label" almost entirely incorrectly.

A "label" is the name or category of a "value". "Title" might be a label name, and a "Alice in Wonderland" is the value.

"Automatic Entity Label" should be called "Automatic Entity Value".

"a small and efficient module that allows hiding of entity label fields" is incorrect, because there's no such thing as a "label field" - it's a "field label". "To prevent empty labels it can be configured to generate the label automatically by a given pattern." is also incorrect - a Label is *never* empty. The correct term is "value". Et cetera, et cetera. Spent an hour today tracking down a bug because I *ignored* this module entirely since I erroneously believed it worked on labels only, and not field values.

(The above examples are just rife in the module's description - the end-user strings in the module itself are also problematic.)

CommentFileSizeAuthor
#17 auto_entitylabel.zip10.28 KBAlexanderBoev
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

bforchhammer’s picture

Status: Active » Closed (works as designed)

A "label" is the name or category of a "value". "Title" might be a label name, and a "Alice in Wonderland" is the value.

This may be the general definition of what a "label" is, however, for the context of drupal entities, the general definition of an "entity label" is the following (see hook_entity_info(), "label callback"):

The entity label is the main string associated with an entity; for example, the title of a node or the subject of a comment.

"Automatic Entity Label" should be called "Automatic Entity Value".

Sorry, but in my opinion "entity value" does not make it any easier to understand what this module does... If you have any other suggestions about how to improve the module page and make the module easier to find, I'm happy to hear them.

Morbus Iff’s picture

Status: Closed (works as designed) » Active

FWIW, what you quoted me from hook_entity_info() does not support your argument. It is *not* talking about "Alice in Wonderland" (the value), it is talking about "Title" (the label). See "label" in the same documentation ("the human-readable name of the type"). In what you quoted, it is literally talking about the "title [label] of a node" as in the "Title" of a "Title: [value goes here]", not the "[value goes here]". See also entity_keys:label, which talks about "$entity->subject" not "$entity->alice_in_wonderland". Finally, the display settings in Field UI also clearly distinguish between "label" (the thing that goes "around" the value) and the "format" (which corresponds to how one would display the value). What you've pasted supports my lament, not your rebuttal. Similarly, "human-readable" and "string" does not always describe the *value* of a field, but it always describes the *label* of a field.

I'm going to reset this to "active" only because I contest "works as designed", since the docs
don't support your argument. "closed (won't fix)" might be a likely next contender.

"Automatic Field Value"?

bforchhammer’s picture

See "label" in the same documentation ("the human-readable name of the type").

That one actually talks about the label of the entity type, i.e. "Article" or "Story". The "Entity label" is what is displayed in a list of entities to represent an entity... e.g. "Alice in wonderland" as the title for a "story" entity.

"entity_keys:label" talks about "$entity->subject" being the property which contains the entity label.

In terms of the name of this module, "Field" does not fit 100% either, as the label may also be a "Property" of the entity; I guess "Automatic entity label value" might be a more correct name. However, renaming the module means a fair bit of work overhead (creating a new module, renaming functions, updating strings and docs, etc.), so I'm not going to rename it unless a majority of users thinks that it's absolutely necessary.

I'd still be happy to discuss improvements to the module description though...

Morbus Iff’s picture

That one actually talks about the label of the entity type, i.e. "Article" or "Story". The "Entity label" is what is displayed in a list of entities to represent an entity... e.g. "Alice in wonderland" as the title for a "story" entity.

There's an implication here that "label" means the same thing in Drupal everywhere. The "Entity label"
here is, as you say, "Story" or "Article". "Alice in Wonderland" has nothing to do with it.

"entity_keys:label" talks about "$entity->subject" being the property which contains the entity label.

To clarify "contains", if the label is set as "Subject", then the property is assumed to be "$entity->subject". The value stored inside $entity->subject is "Children's Fiction", for instance, not the label "Subject". This is probably the clearest delineation between "label" and "value" available: $entity->LABEL = VALUE; as in $entity->subject = 'Children's Fiction';. Unless I'm woefully mistaken, this module generates a "Children's Fiction"-like value for a particular entity's property or field, not the names of the properties/labels themselves.

cf. "Field": agreed.

"Automatic entity label value" is probably good enough, though long and ugly. Along the same lines "Automatic entity property value" would also work, but given that "property" is not really a term ever exposed to the end-user, isn't ideal. (With that said, "label" is only ever exposed to the end-user as the name of a property/field, not its value, which is partially why "Automatic Entity Label" is confusing.)

[EDIT: I'll see if I can work on a proposed/revised module description a bit later this week.]

bforchhammer’s picture

spira: This may be a case of too little too late, and please excuse me if I've misunderstood.. but isn't calling the module "Automatic Entity Label" a bit misleading regarding terminology? Aren't labels actually the textual descriptor that goes above, below or inline with a field to describe what it is, not the actual field itself? As is, it sounds like the module is providing the functionality to automatically set the labels that go with a field, which isn't actually the case.

This is a handy module, and I'm glad to see this functionality extended to all entities rather than just nodes like its' predecessor, Automatic Nodetitles.

bforchhammer’s picture

Title: Strings are a mass of misunderstandings » Improve project description / terminology
Version: 7.x-1.0 » 7.x-1.x-dev
hass’s picture

Automatic Entity Title is more correct module name.

hass’s picture

redndahead’s picture

Status: Active » Needs review
FileSize
54.91 KB

Here is a patch that renames the entire module. I have changed it from auto_entitylabel to auto_entity_title (the missing _ always bothered me in auto_nodetitle).

I haven't tested it yet, but hopefully it's good.

redndahead’s picture

FileSize
108.23 KB

Here is a module to download.

redndahead’s picture

FileSize
110.46 KB
54.91 KB

Missed a couple of globals.

bforchhammer’s picture

Status: Needs review » Active

Thanks for your efforts. I'm still not convinced that renaming "label" to "title" is a good way forward. I understand how it might make it easier to understand for some people, but on the other hand core does already use the term "entity label" to describe node titles, comments subjects etc.; so using "label" is definitely consistent with core API (see entity_label and my comments above).

Besides, there is no easy way to rename a module on drupal.org. I would have to create a new project and move everything over manually; a new module namespace also means that update checks will break for all existing users, and of course any existing variables won't work anymore so people would need to reconfigure their patterns (or we would need an update function)...

I'd still prefer if we could just try to improve the module description instead.

redndahead’s picture

My patch includes the update function and while I understand that core functions call it label every visible place calls it title. So if you are set on keeping the module name I would change all the visible text to title. What do you think about that proposal?

bforchhammer’s picture

I've been trying to find more documentation on why core uses "label" instead of "title". From what I can see, the terminology was introduced in #629484: Add entity 'label' key info (e.g. title on node), and the naming issue is discussed in comments #83 to #87. Webchick finally settles on "label" with the following comment:

On the naming, I'm a bit unsure. "Title" has a very specific meaning within the context of nodes. "Name" has a very specific meaning within the context of users. "Label", while not perfect, is at least a new word (in terms of core) that doesn't have any pre-existing meaning that people need to "un-learn", and applies fine across all entities I can think of (except, I guess, an entity with an identifying field called "Label" :P) without ambiguity on what's being talked about. So I think I'm fine with "label", at least for D7.

So if you are set on keeping the module name I would change all the visible text to title. What do you think about that proposal?

I'd be okay with changing UI text depending on the context, e.g. calling it "automatic node title" in the context of the nodes, "automatic taxonomy term name" for vocabularies, and falling back to "automatic entity label" when we don't know any better. Node types have a "title_label" property which could be used, I'm not sure about other entity types.

I'm also still open to suggestions on how to improve the module description, which I believe was the original issue raised by Morbus Iff.

[...] I *ignored* this module entirely since I erroneously believed it worked on labels only, and not field values.
gozigzag’s picture

I was quite confused about what this module does initially and agree that description could be improved. So, it works on Node titles, comment subjects, taxonomy term names...any other examples? Please tell me if I'm wrong, and sorry if you don't like my choice of terminology, but basically this works on auto creating a value for an entity's identifying name such as node title, comment subject.

This module does not auto create values for a node text field, correct? Say, I create a new text field for Article content type. This module won't allow me to automatically put a value in for this field, will it? I'm not necessarily asking for feature request here, but could see where someone might be looking for this functionality.

So for description - I recommend explaining a little more clearly what this module works on. At the moment it reads:

"Automatic Entity Label" is a small and efficient module that allows hiding of entity label fields. To prevent empty labels it can be configured to generate the label automatically by a given pattern.

suggest explaining what "entity label fields" refers to.

This can be used on any entity type, including e.g. for node titles, comment subjects, taxonomy term names and profile2 labels.

Could improve. The examples given here are key to understanding. Should say something like - entity types such as nodes......and then explaining that for nodes, the "entity label field" is Title.

gozigzag’s picture

Issue summary: View changes

Appending example boundaries.

dqd’s picture

Issue summary: View changes

EDIT: what happend to the files and the revision? I definitely didn't touched it. Any idea how to get them back in the topic?


#14

I've been trying to find more documentation on why core uses "label" ...

That's what has caused the title "field" confusion. And, this is ONE of the less Drupal curiosities which made me really smile a lot of times, even as a non developer, since this is definitely a troublemaker based on a missing name convention issue in the past and a missing name consistency between the theme layer and the field layer. Exactly that is what has caused, that the title "field" needs such a module. Because of the different understanding of what this "field" was maybe meant for, in its earlier days. Community use-cases have changed its meaning. I quote the "field" because it wasn't meant like a "field" in the way we use the word nowadays in Drupal world.

Drupal sets high standards in web application and modular site building and makes most CMS or frameworks looking old. But we should not forget that Drupal isn't really young no more and that there are already some small old left-overs in the corners. Like what we know as node titles. And that's where all the trouble has started and how it even became worse because this "title" was hard coded html as "title" of the published content in the system tpl files ($node->title) and that's why it became the "content headline" for the most users. But that was only ONE use-case, promoted by the theme layer causing many confusion. And this is where it crashes with its meaning. A title is a pseudonym in publishing world for headline and this is what it connotes by looking in the tpl's. But I think, it was traditionally maybe meant like something else: like a label. You could see it as a description part sticky to the ID. Let's explain it on nodes, this is easier: an NID is saying nothing but that it was created AFTER a LOWER NID. So been sad, a short description to the NID would say more to the node (or any bundle). The label was born. That's why the field is configurable on the edit page of the content type, not in the field manager. The idea behind this was rather a mandatory label value regarding each bundle data entry. The theme layer was adopting it and sad: Hey great, that'S what we will use as the title anyway, so lets render it here. Don't forget: it was the late 90's early :-) And you can give it another name. Not explicitly title. You can call it description or label in the content type edit form. The confusion is perfect now. From a data designers perspective and thinking of building bundles with fields or from the publishers side this is nonsense today. For those the title field is just another field like other fields, which are common for us today and not a CCK module no more, and the NID is mandatory and unique enough for a bundle. Wouldn't it be part of the system tpl files since ages, I am sure most users would have been created own headline fields and gave them an additional seat in the $content rendering bundle in the tpl files long before and we wouldn't be so confused about the "label".

Today we know the power of Drupal over the most other traditional CMS or web application frameworks and we see it as "builder" of input forms combined with builders of output, were we are able to make even Groupware or project management systems etc possible. And we mostly think in terms like "fields" grouped in bundles. Our so loved nodes and today entities :-) Like in a storage grid or in a database or in a spreadsheet. From THIS point of view, the label was seen as title field, and that being sticky and mandatory in bundles feels obsolete, as long as it doesn't become usable in a flexible manner, as the title field. That's why we have so many modules in the contrib as a work around. Like this one. Let's face it: most bundles are for being published or viewed at minimum, so most of them need something like a short "what is this entry about" in most bundles. That's why the discussion before D7 core feature freeze was not priority to make this a full and not mandatory field or leave it completely to the bundle if it needs a title or not, but mostly it does. Like the problem with the username. And for the most users a "title" is a headline, like in news, but in fact it is rather a label for an entry in the field bundle. We CAN but we don't NEED TO use it as the headline in the output. But this is where the trouble from the beginning made more waves: Most themers were supporting the examples in the system tpl files, which use it indeed as a headline and render the $node->title on top of $content and this is how this label field became a headline field for the most users in their mind. It all began with the try to seperate the label of a single node from the label of the node type with another convention, the $node->title. But in fact it is rather a label not a title. Especially rather more in entities world than in the node century.

AlexanderBoev’s picture

FileSize
10.28 KB

Доработал модуль под Drupal 8 чтобы он работал ниже архив с модулем прикрепляю.
Единственно то что не тестировал это с PHP. С токинами работает как надо.

-----

Finalize the module at Drupal 8 that it works below the file with the module attached.
The only fact that did not test it with PHP. With Tokin works as it should.