Problem/Motivation

In NodeTypeForm:actions the
$actions['delete']['#value'] = t('Delete content type');
code line has no effect.

Proposed resolution

Let's remove the line. No changes to the UI, no changes to tests, and consistent with the very similar vocabulary edit screen.

Remaining tasks

  1. Write a patch
  2. Review
  3. Commit

User interface changes

None.

API changes

None.

Data model changes

None.

Comments

Pasqualle created an issue. See original summary.

pasqualle’s picture

Status: Active » Needs review
StatusFileSize
new650 bytes
pasqualle’s picture

StatusFileSize
new44.29 KB
new45.33 KB
idebr’s picture

Issue summary: View changes
StatusFileSize
new771 bytes
new1.39 KB

Nice find!

Attached patch adds test coverage. Interestingly it did not fail because 'Delete' partially matches 'Delete content type'.

The last submitted patch, 4: 3056616-4-test-only.patch, failed testing. View results

pasqualle’s picture

Status: Needs review » Reviewed & tested by the community
pasqualle’s picture

The code works now, but I am thinking if we should not just have "Save" and "Delete" action labels. As I see no other entity cares to modify the labels in core or contrib..

pasqualle’s picture

Status: Reviewed & tested by the community » Needs review
Issue tags: +Needs UX review
idebr’s picture

I suggest we move the question "Should the entity type be mentioned on the save/delete button?" to a followup issue and keep this scoped to a simple bug fix. The intended UX was developed a long time ago (see #111715: Convert node/content types into configuration where the current code was implemented back in 2013).

pasqualle’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: -Needs UX review

ok

The last submitted patch, 4: 3056616-4-test-only.patch, failed testing. View results

The last submitted patch, 4: 3056616-4-test-only.patch, failed testing. View results

The last submitted patch, 4: 3056616-4-test-only.patch, failed testing. View results

The last submitted patch, 4: 3056616-4-test-only.patch, failed testing. View results

The last submitted patch, 4: 3056616-4-test-only.patch, failed testing. View results

The last submitted patch, 4: 3056616-4-test-only.patch, failed testing. View results

gogowitsch’s picture

+1: Patch & test look good to me.

The last submitted patch, 4: 3056616-4-test-only.patch, failed testing. View results

The last submitted patch, 4: 3056616-4-test-only.patch, failed testing. View results

The last submitted patch, 4: 3056616-4-test-only.patch, failed testing. View results

The last submitted patch, 4: 3056616-4-test-only.patch, failed testing. View results

The last submitted patch, 4: 3056616-4-test-only.patch, failed testing. View results

The last submitted patch, 4: 3056616-4-test-only.patch, failed testing. View results

idebr’s picture

StatusFileSize
new1.39 KB

Reupload of #4 to reduce testbot clutter.

alexpott’s picture

Status: Reviewed & tested by the community » Needs work

Let's remove the line instead. No changes to the UI, no changes to tests, and consistent with the very similar vocabulary edit screen.

init90’s picture

Status: Needs work » Needs review
StatusFileSize
new582 bytes

Sounds logical. Updated according to last comment.

idebr’s picture

Issue summary: View changes
Status: Needs review » Reviewed & tested by the community
  1. Updated the issue summary with the proposed resolution in #25
  2. Patch applies cleanly to 8.8.x, RTBC assuming the tests come back green.
alexpott’s picture

Title: "Delete content type" link title » Remove dead code in NodeTypeForm::actions()

Changing the title to reflect what's happening here.

alexpott’s picture

Category: Bug report » Task
alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed 8ca1b5a7c5 to 8.8.x and 9c815fd316 to 8.7.x. Thanks!

As this code is not used I've backported this to 8.7.x to keep the branches in-sync. I spent a bit of time trying to find an issue about standardising these buttons but then realised that even if this the new standard would be for this button to read 'Delete content type' then we'd need to handle that change correctly. And this code is still dead. So removing it now is fine even if we decided to change the button text at a later date.

It'd be great if someone could try to find that issue about standardising button texts because I think we probably should open a follow-up to completely remove the method override here.

  • alexpott committed 8ca1b5a on 8.8.x
    Issue #3056616 by idebr, Pasqualle, init90, alexpott: Remove dead code...

  • alexpott committed 9c815fd on 8.7.x
    Issue #3056616 by idebr, Pasqualle, init90, alexpott: Remove dead code...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.