Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
Currently contact categories are exposed to own URLs contact/{contact_category}
so actually they are not categories but separate forms on their pages (except personal)
So managing categories is confusing.
Proposed resolution
Rename contact_category
entity to contact_form
and all relates strings/menus
That was suggested in #1997692-33: Create contact form block
Remaining tasks
discuss and file patch
User interface changes
UI strings
API changes
tbd
Comment | File | Size | Author |
---|---|---|---|
#51 | Screenshot 2014-08-15 07.18.45.png | 35.11 KB | larowlan |
#50 | contact-form-2285083-50.patch | 69.57 KB | andypost |
Comments
Comment #1
BerdirThe rename makes a lot of sense to me and while it's a huge API change for anyone already using it, I doubt that many are doing that...
Comment #2
sunI can see how "Category" might be confusing/ambiguous, but "Page" is very ambiguous, too... (?)
If you were to place a contact form into a block, then the selector would ask you which "Page" you want to use.
I'd recommend to just simply name this a "Contact Form", because that's what it is...
That name would only get a bit confusing at the Entity API level under the hood - a "contact form" has multiple "form modes" etc.pp. - but not sure whether that low-level detail really matters.
Comment #3
seantwalsh@sun good point "form" makes the most sense. Going to start work on this patch today.
Comment #4
BerdirContact form works as well for me.
Comment #5
andypost+1 to "contact form"
Comment #6
BerdirContact form it is.
Comment #7
larowlan@crowdcg are you still interested in working on this?
Comment #8
seantwalsh@larowlan, yes initial patch tomorrow. Have been working on it piecemeal, but think I need to just get a first patch up to iterate and get feedback on.
Comment #9
seantwalshComment #10
andypost@crowdcg is there any progress? I'm planing to fix it
Comment #11
seantwalsh@andypost, et al. This is a simple patch, mainly focusing on the UI. I guess my big question is if all the "category" used in code should be changed to use "form" or "contactform" or something else. Also should the file names, classes, functions, etc. all be changed as well. I tried this holistic approach earlier in developing this patch but was unsuccessful. Feedback and direction greatly appreciated, at least this patch makes the interface less confusing.
Comment #12
er.pushpinderrana CreditAttribution: er.pushpinderrana commentedComment #14
andypostthis breaks setup
Comment #15
seantwalshOuch, that's what I get for submitting that so late at night. Patch that doesn't break setup attached.
Comment #16
BerdirComment #18
BerdirYes, the entity type should be renamed to contact_form, form for the config prefix.
Not sure about the class name, just naming it "Form" seems like a bad idea, so possibly "ContactForm" ?
Comment #19
seantwalsh@berdir, thanks for the direction. Agreed on the second point as well. Will work on another patch incorporating those suggestions.
Comment #20
sunHm. Don't we need to update all of these, too?
(and elsewhere)
A straight s/category/form/g replacement results in a lack of context in the UI strings. They should be replaced with "contact form" instead (which is a unique term).
The administrative listing is the only case where "form" may not be accurate, or at least results in a suboptimal language/presentation. Changing it into "Contact form" won't improve it either...
We may want to ignore this issue; just wanted to point it out.
Duplicate "form".
Typo in "fiorms"
Comment #21
seantwalshThanks @sun! Resolved all five I believe in this patch.
Comment #23
seantwalshNeed to pay more attention...trying again!
Comment #25
seantwalshHopefully this patch resolves most of the errors and exceptions.
Comment #27
seantwalshOne more time with feeling!
Comment #29
BerdirThe schema doesn't match with the config_prefix.
Not 100% sure, but I do think that a config prefix of "config_form" is better than just form (which means you can leave out the explicit definition, as the default is the entity type ID anyway). So update the schema and the default config files to contact.contact_form.
I guess this is really a ContactFormForm class now? A form for editing contact forms :) Or maybe ContactFormEditForm?
Also, please set up your git configuration to better track renames, look for renames = copies in https://www.drupal.org/documentation/git/configure. Makes the patch much smaller and easier to review.
Comment #30
Berdir1. That said, form is probably not more generic than "type", so that might work too and is possibly easier to change. @larowlan, @andypost?
Comment #31
sun"type" isn't really clear on what it is. A [contact] "form" is a form. A [contact] type is… a "friend", "co-worker", etc category. — Let's avoid the "node type" trap (double-meaningless).
I think we should keep "contact form" in UI strings. However, if "form" presents an issue at the code level, then alternative synonyms are possible - whichever synonym we choose though, it should transport the same meaning. E.g.: channel, funnel, tunnel, connection, junction, etc.
Comment #32
BerdirI think you misunderstood me :)
I did not mean to change form to type, I'm very +1 on form, the UI strings, entity class and entity type ID should be contact form/contact_form/ContactForm.
I'm *only* wondering if the config prefix should be config_form or just form. form seems very generic, but I was just making the point that if node.type is OK (and custom_block.type, and comment.type), then contact.form is probably OK too.
Comment #33
seantwalsh@Berdir, thank you for the feedback and helpful link to git configuration. I've adjusted my .gitconfig and .gitignore, so patches should be smoother from here on out!
1. I've updated the contact.schema.yml, but just so I'm clear, the files contact.form.* under contact/config/install should also now be contact.contact_form.* correct?
2. Personally, I think ContactFormEditForm is clearer than ContactFormForm even if it is more verbose :)
Comment #34
Berdir1. Yeah, whether we chose to go with contact_form or just form, the schema, default config files and config_prefix/id in the entity type annotation all need to align. Then hopefully the test fails will go down :)
2. Yeah, the only problem with that is that form would also be used for adding contact forms :)
Comment #35
sunSounds like we really need a different noun under the hood. "form" is definitely problematic. And before renaming it to "type", I'd rather keep the current "category"... :P
We also need to watch out: English is both a colorful but also poor language, so it's easy to fall into the trap of using words that don't exist, don't have a meaning, and worse, which are not translatable into other languages.
How about this? — contact point
In essence, we're talking about a thing that defines a communication recipient and available information that may be communicated to the recipient for a certain purpose. The fact that communication happens through a web form is not really relevant (and might not necessarily be true, who knows…?). We're defining a possible point of contact, or contact point.
Comment #36
andypostSuppose #30 exposes good idea to unify this to type as all over core does.
This is a really type of contact that accessed via message form
Comment #37
larowlanI'm not fussy, but if I had to choose I'd keep the prefix as contact_form instead of form or type.
+1 to ContactFormEditForm instead of ContactForm for the form.
Comment #38
radiit CreditAttribution: radiit commentedgo listen to the discussion
Comment #39
larowlanLets see whats still broken
Comment #40
larowlanLocal tests came back
Comment #43
larowlanComment #44
andypostRe-roll of #43 with shorter config prefix
s/contact_form/form/
Also
this change is wrong, d7 database field name is 'category' so it's not clear how this passes a tests and is this used at all...
PS: pushed to
contact-form-2285083-andypost
branch of https://www.drupal.org/sandbox/larowlan/2304799Comment #45
BerdirShould we use "Add contact form" here and possibly in other UI strings?
I don't think the new description makes sense? It was about a single system contact form with categories.
Can be simplified to just "Create and manage contact forms" or something like that.
Same here.
Not sure this makes sense either :)
Was like this before I guess, but seems strange, it *is* an interface, i doesn't provide one? Just "Interface for contact form entities" or so?
While touching, change to Contains \Drupal.. ?
"Contact form"?
Looks like this is just a test, but still, "contact form" ? ;)
Comment #46
andypostfixed 1, 2, 3, 6, 7
4) renamed to 'Contact' as '/contact' route has, the title for this pages is set in controller
5) There's no suggestions for interfaces https://www.drupal.org/node/1354#classes but checking other entity interfaces they are all used to "Provides an interface"
8) fixed, but this string is not used
Comment #47
andypostFiled follow-up #2317309: Document that Tests in ContactSitewideTest are run twice
Comment #48
BerdirLooks nice to me, would be good to have an API change approval but this is RTBC IMHO, makes it much clearer what those things actually are.
Only part that might need discussion is the config prefx, I'm ok with either form or contact_form.
Comment #49
andypostRe-roll after #2154435: Rename EntityAccessController to EntityAccessControlHandler
Comment #50
andypostre-roll
Comment #51
larowlanrtbc
screenshot from manual testing
Comment #52
seantwalshSeems to work fine for me as well. A small nitpick...the term "Label" for the title of the form seems strange to me.
Comment #55
andypostComment #56
alexpottI think we need a change record to tell everyone contact categories and now contact forms.
Change records that need an update:
Comment #57
andypostCR draft filed https://www.drupal.org/node/2322527
PS: I will update other CRs after commit
Comment #58
alexpottCommitted 093ea79 and pushed to 8.0.x. Thanks!
Comment #60
andyposthttps://www.drupal.org/node/2023711/revisions/view/2734785/7540047
https://www.drupal.org/node/1818734/revisions/view/7468015/7540051
Also linked the issue
Comment #62
andypostComment #64
bedlamThere's an open issue (issue #2091395) related to the hook_help() text of this module that relates to the changes in this issue. Cross-linking them on the advice of sprint mentor.
Comment #65
bedlam