Problem/Motivation
As suggested in the comment https://www.drupal.org/node/2400543#comment-10461821 we need to improve the titles of the term and vocabulary pages. The titles should reflect on the edit as well as the delete page.
In particular, people editing a taxonomy term cannot see what vocabulary it is in. This is not good in its own right, and inconsistent with how editing content works, where you can see what content type it is.
Proposed resolution
- Change the vocabulary edit page title from "Edit Vocabulary" to "Edit Vocabulary_Name"
- Change the term edit page title from "Edit Term" to "Edit Term_Name in Vocabulary_Name"
Remaining tasks
User interface changes
None.
API changes
None.
Data model changes
None.
Screenshots
Before patch Edit of Vocabulary:
After patch Edit of Vocabulary:
Before patch Edit of Term:
After patch Edit of Term:
Comment | File | Size | Author |
---|---|---|---|
#90 | 2596207-90.patch | 1.81 KB | shashank5563 |
| |||
#78 | Before patch #69.png | 63.01 KB | yashingole |
#78 | After Patch #69.png | 61.81 KB | yashingole |
#74 | drupal-vocabulary_form_titles-2596207-74.patch | 4.6 KB | Mirroar |
#73 | After_patch_pic.png | 66.69 KB | vikashsoni |
Issue fork drupal-2596207
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
Nitesh Pawar CreditAttribution: Nitesh Pawar at Trigyn Technologies Ltd commentedComment #3
Nitesh Pawar CreditAttribution: Nitesh Pawar at Trigyn Technologies Ltd commentedComment #5
Nitesh Pawar CreditAttribution: Nitesh Pawar at Trigyn Technologies Ltd commentedComment #6
Nitesh Pawar CreditAttribution: Nitesh Pawar at Trigyn Technologies Ltd commentedComment #9
Nitesh Pawar CreditAttribution: Nitesh Pawar at Trigyn Technologies Ltd commentedModified Test.
Comment #10
Nitesh Pawar CreditAttribution: Nitesh Pawar at Trigyn Technologies Ltd commentedComment #11
Nitesh Pawar CreditAttribution: Nitesh Pawar at Trigyn Technologies Ltd commentedComment #12
Nitesh Pawar CreditAttribution: Nitesh Pawar at Trigyn Technologies Ltd commentedResolved the conflict happening for the forum & container add page.
Comment #13
ameymudras CreditAttribution: ameymudras as a volunteer commentedRemoved unwanted space.
Comment #14
Nitesh Pawar CreditAttribution: Nitesh Pawar at Trigyn Technologies Ltd commentedComment #15
Shreya Shetty CreditAttribution: Shreya Shetty at Trigyn Technologies Ltd commentedIts working good. Looks like RTBC to me
Comment #16
Nitesh Pawar CreditAttribution: Nitesh Pawar at Trigyn Technologies Ltd commentedComment #17
xjmThanks for the patch! This change would be a good improvement for usability.
This change would break strings, so we cannot make it any more during RC. We could improve this in a minor version, though. Reference: https://www.drupal.org/core/d8-allowed-changes
These are not correct uses of
t()
. Variables should always be added to the string using string placeholders for security and to allow them to be translated properly with context. See the documentation of the method for details.Edit: Note that I've postponed the issue for now since 8.1.x is not open for development yet. Once it is, we can create an updated patch that improves the use of
t()
.Comment #19
yoroy CreditAttribution: yoroy commentedComment #20
Sagar Ramgade CreditAttribution: Sagar Ramgade as a volunteer and at Trigyn Technologies Ltd commentedPatch updated with correct usage of t().
Comment #21
Sagar Ramgade CreditAttribution: Sagar Ramgade as a volunteer and at Trigyn Technologies Ltd commentedComment #23
pixelmord CreditAttribution: pixelmord at Wunder for Hubert Burda Media commentedI think this is very much needed but I would suggest to also include the vocabulary name since they are very closely tied together and you have to get the context of which vocabulary that term belongs to. Like so:
Edit term "Apple" in "Fruits" vocabulary
See the related issue for dealing with the breadcrumbs #1905370: Add missing vocabulary to fix term edit form breadcrumbs
Comment #24
bovidiu CreditAttribution: bovidiu commentedOn the recommendation of #23 i've added : Edit term "Apple" in "Fruits" vocabulary
Comment #26
pixelmord CreditAttribution: pixelmord at Wunder for Hubert Burda Media commentedI think since we're stating the type for the vocabulary name, we should also do this for the term: e.g. Edit term XXXX in YYYY vocabulary. And to mark the names a little better I would suggest to wrap the part of the text that is about the operation in s like we do that for the Node form.
So we would have:
Edit term XXXX in YYYY vocabulary
<em>Edit term</em> XXXX <em> in YYYY vocabulary</em>
$term->bundle() will not give you the name of the vocabulary, but the machine name
I will provide a new patch for that
Comment #27
pixelmord CreditAttribution: pixelmord at Wunder for Hubert Burda Media commentedHere's an updated patch, I addressed the issues mentioned in #26 and added tests
Comment #28
pixelmord CreditAttribution: pixelmord at Wunder for Hubert Burda Media commentedForgot to set the status ...
Comment #29
krina.addweb CreditAttribution: krina.addweb at AddWeb Solution Pvt. Ltd. commented@pixelmord Thanks! For your patch,It works for me same as #26.
Comment #32
chr.fritschFixed the last failing test
Comment #34
mtodor CreditAttribution: mtodor at Thunder commentedProblem with test is randomization of name for Forum, that makes order of forums different randomly -> once "General discussion" is first in list, once new created forum is in front. So I made small quick solution, that first letter starts with 'f' (forum) and then it will always be in front of "General discussion".
Let's see will that work on TestBot.
Comment #35
chr.fritschOk, lets go back to RTBC
Comment #38
chr.fritschPatch, should still apply. Lets test
Comment #39
chr.fritschThis is still green. Retested #34
Comment #40
xjmCan we get before/after screenshots here? Also specifically of the Forum taxonomy forms changed as a consequence of the patch. The test changes needed to make Forum work with this patch are kinda suspicious and make me wonder if we need to add a different actual fix for Forum.
Even if we do use the current change for forum, we should probably not use the random name at all and just use an intentional test value.
Comment #41
mtodor CreditAttribution: mtodor at Thunder commentedI have changed testing a bit. Instead of changing random name, I have changed weight, so that new created forum is first in list. Changing randomization of name is another topic and it's not related with this issue. I personally prefer fixed names (so that tests do not flip-flop), but other developers prefer that tests discover problems.
I have attached screenshots. I have added for term and vocabulary in summary and here are forum related ones.
Before patch Edit of Forum:
After patch Edit of Forum:
Comment #42
Truptti CreditAttribution: Truptti at Axelerant commentedVerified the patch '2596207_41.patch' in #41 on Drupal 8.4.x.The observations are as follows:
1.The patch got applied without any errors
2.The title for Edit Vocabulary is changed to 'Edit Vocabulary-name' eg . Edit Category
3.The title for Edit Vocabulary term is changed to Edit name in Vocabularyname vocabulary' eg. Edit test in Category vocabulary'
4.The title for Edit Forum is changed to 'Edit name in Forums vocabulary' eg 'Edit test in Forums vocabulary'
Attaching snapshot for reference
This can be marked as RTBC.
Comment #43
Truptti CreditAttribution: Truptti at Axelerant commentedComment #45
gaurav.kapoor CreditAttribution: gaurav.kapoor at OpenSense Labs commentedComment #46
gaurav.kapoor CreditAttribution: gaurav.kapoor at OpenSense Labs commentedRe-roll.
Comment #47
jofitz CreditAttribution: jofitz at ComputerMinds commentedCorrect coding standards issues - "Short array syntax must be used to define arrays"
Comment #48
David_Rothstein CreditAttribution: David_Rothstein as a volunteer commentedLinking to a similar issue, but for adding terms rather than editing them.
Comment #49
Dinesh18 CreditAttribution: Dinesh18 as a volunteer commentedHello,
I have applied the patch mentioned in comment #47 (2596207-47.patch). It is working as expected. PFA screenshots.
Comment #50
lauriiiComment #51
yoroy CreditAttribution: yoroy commentedAdding
I feel with adding the vocabulary name to the title when editing a term we might be overdoing it a bit. I don't think we should use the title to express hierarchy or relationship.
Is it at all possible to show the vocabulary name in the breadcrumb instead?
Because that is what happens when creating a new term:
Comment #54
PanchoNeeds a reroll.
Comment #55
jofitz CreditAttribution: jofitz at ComputerMinds commentedRe-roll.
Comment #57
joachim CreditAttribution: joachim as a volunteer commentedThis isn't quite right.
Looking at nodes, the content entity, the node, has:
> /Edit Article/ Title
(i.e., all EM except the entity label)
The config entity, the node type, though has:
> Edit /Article/ content type
(i.e., only the entity label is in italic.)
Is that correct? That seems odd to me, but maybe there is a UX reason.
So either:
1. we follow suit, and the vocab edit page shoud be like the content type edit page
2. we file / look for an issue to see whether the italic discrepancy is indeed a discrepancy
Comment #59
ckaotikThe patch in #55 needs a reroll, as it causes a whitepage on systems with Drupal 8.7+. The
Vocabulary
class was moved (or removed), soVocabulary::load
fails. Possible replacement:$vocabulary = $term->vid->entity;
Comment #60
joachim CreditAttribution: joachim as a volunteer commented> The Vocabulary class was moved (or removed), so
I don't think that's the case:
8.7:
8.8:
Entity::load() still exists, so I don't know why that would cause a problem.
At any rate though, Entity::load() is not recommended, so $term->vid->entity is a good replacement just stylistically.
Comment #61
ckaotikThat's indeed incorrect, my bad. I suspect our issue was actually that the patch didn't apply cleanly (possibly due to other patches), so we were missing the added
use Drupal\taxonomy\Entity\Vocabulary;
statement which in turn caused a whitepage:Comment #62
ckaotikI've ported the patch for moved test files. I've also changed the title text slightly, to reduce the amount of emphasized text to
<em>Edit</em> @name in %parent vocabulary
(old:<em>Edit</em> @name <em>in @parent vocabulary</em>
).I didn't get the overridden titles on term forms, though that might be because of other modules. Let's see how the tests fare.
Comment #64
ckaotik> I didn't get the overridden titles on term forms, though that might be because of other modules. Let's see how the tests fare.
Well, guess it wasn't just my setup then. But I wonder, why does the
$form['#title']
not stick? The route's title would be "Edit term", but what's displayed is simply "My term name".Comment #69
Qusai Taha CreditAttribution: Qusai Taha at Vardot commentedI edited the patch 62 to perform the following:
1 - When adding a new term (Add term) => Add "vocabulary_name".
2 - When Editing term (Edit term)=> Edit (term_name).
3 - When Editing vocabulary (Edit vocabulary) => Edit (vocabulary_name).
Comment #70
vsujeetkumar CreditAttribution: vsujeetkumar at Srijan | A Material+ Company for Drupal India Association commented@qusai taha I think you missed some tests changes as per #62, I have added those and fixed fail tests, Please have a look.
Comment #72
vsujeetkumar CreditAttribution: vsujeetkumar at Srijan | A Material+ Company for Drupal India Association commentedComment #73
vikashsoni CreditAttribution: vikashsoni as a volunteer and at Zyxware Technologies commentedAppiled patch #69 working fine now title added when edit vocublary for ref sharing screenshot ...
Comment #74
Mirroar CreditAttribution: Mirroar at werk21 commentedI've rerolled the patch from #70 against 9.3.x and added a test for the title change when adding taxonomy terms.
Comment #77
yashingole CreditAttribution: yashingole at QED42 for Drupal India Association commentedComment #78
yashingole CreditAttribution: yashingole at QED42 for Drupal India Association commentedVerified and tested patch #69 on Drupal 9.5.x-dev. Patch applied successfully and looks good to me.
Testing steps:
1. Install 9.5
2. Visit /admin/structure/taxonomy/add
3. Add a new vocabulary.
4. Edit vocabulary.
5. Observe the "Edit Vocabulary" heading.
6. Apply patch #69
7. Observe the heading "Edit "
Testing Result:
1. After applying the patch heading of the edit page has changed. Screenshots are attached for reference:
Can be move to RTBC
Comment #80
quietone CreditAttribution: quietone at PreviousNext commentedThanks everyone for working on this issue. Remember to read the comments before rerolling a patch. Comment #57 has not been addressed. Setting NW for discussing and consider #57.
The screenshots in the Issue Summary are to be from the latest patch. The Issue Summary also has states that this is not making User Interface changes and it is. That needs to be corrected. The Issue Summary needs to be updated. I am adding the tag for that.
I also don't see a code review here. That needs to be done as well.
@yashingole, thanks for listing what you did to test the patch.
Having a working patch is not usually sufficient to mark an issue RTBC. There are several steps, or Review a patch or merge request task of the Contributor guide is sufficient. The complete list of core gates has more topics. Also, check the tags on the issue and make sure they are complete.
Comment #84
smustgrave CreditAttribution: smustgrave at Mobomo commentedClosed #3355627: Improve the Vocabulary edit form title as a duplicate
Comment #87
sakthi_dev CreditAttribution: sakthi_dev at Specbee for Drupal India Association commentedPlease review.
Comment #88
smustgrave CreditAttribution: smustgrave at Mobomo commentedStill needs an issue summary update
And not sure why this needs to change the forum test? Want to make sure we aren't just editing the tests to pass.
Comment #89
sakthi_dev CreditAttribution: sakthi_dev at Specbee for Drupal India Association commentedHi @smustgrave. Forum module is linked with Taxonomy as the Forum container are getting added in taxonomy term and uses term and vocabulary forms. So the test of Forum module checks the title of vocabulary and term forms. Hope it is clear to you now. Thanks!
Comment #90
shashank5563 CreditAttribution: shashank5563 at Melity commentedFor the Vocabulary edit form title to apply this patch.
Comment #92
jannakha CreditAttribution: jannakha as a volunteer and at Tomato Elephant Studio commentedpatch #90 is not valid
Comment #93
mlncn CreditAttribution: mlncn at Agaric for Drutopia, Portside, Teachers with GUTS commentedhttps://git.drupalcode.org/project/drupal/-/merge_requests/3883.diff is applying and working.
Summary updated.
Comment #94
smustgrave CreditAttribution: smustgrave at Mobomo commentedIf 3883 is the MR to be used it should be updated for 11.x and all patches hidden for clarity. Not familiar enough with the issue to make that call.
Comment #96
vsujeetkumar CreditAttribution: vsujeetkumar at Srijan | A Material+ Company for Drupal India Association commentedI have updated the MR for 11.x. Please have a look.
Comment #97
vbouchetComment #98
smustgrave CreditAttribution: smustgrave at Mobomo commentedLeft some feedback.
Comment #99
sakthi_dev CreditAttribution: sakthi_dev at Specbee for Drupal India Association commentedUpdated the test for the new term addition as per comment #98.
Comment #100
sakthi_dev CreditAttribution: sakthi_dev at Specbee for Drupal India Association commentedChanging status to Needs Review as the test case is added and to get the clarity.
Comment #101
smustgrave CreditAttribution: smustgrave at Mobomo commentedAddressed comment, also seems to have some test failures.
Comment #102
sakthi_dev CreditAttribution: sakthi_dev at Specbee for Drupal India Association commentedThanks @smustgrave, added typehint for return type.