Problem/Motivation

Core using following patters to manage config entities
- admin_path/add - create
- admin_path/manage/{id} - edit
- admin_path/manage/{id}/delete - delete and so on..

See vocabularies/views...

For content entities this actions are
- entity_type/{id} - view
- entity_type/{id}/edit - edit and so on

Proposed resolution

As #2372585: Change order of tabs to View / Edit / Translate fixed better to adopt common pattern for config entities

CommentFileSizeAuthor
#5 2922774-5.patch7.65 KBjhodgdon

Comments

andypost created an issue. See original summary.

andypost’s picture

This will allow to get rid of hack with "add" in \Drupal\config_help\Form\HelpTopicForm::exists() (which I guess was picked from old taxonomy implementation and where the path patters were introduced

jhodgdon’s picture

Good idea, let's adopt the standard config entity pattern.

jhodgdon’s picture

Assigned: Unassigned » jhodgdon

Actually, I can do this one today. I don't think it will interfere with any of the other issues we're working on (and can save you a few lines in the autocomplete issue).

jhodgdon’s picture

Status: Active » Needs review
StatusFileSize
new7.65 KB

Here's a patch. I'm running the tests locally... meanwhile, I was unsure.. should we change the view path also? Most config entities don't have a view path, so it's not clear to me whether we should change it. Changing it to manage/{id} seems weird, because viewing isn't managing.

It seems like most content IDs are auto-assigned numbers, so they have no conflict with the "add" page...

Thoughts?

andypost’s picture

That looks great, now next 4 lines could be removed http://cgit.drupalcode.org/sandbox-jhodgdon-2369943/tree/src/Form/HelpTo...

jhodgdon’s picture

Tests passed locally...

andypost’s picture

maybe add a test for "add" machine name?

  • jhodgdon committed c0a231e on 8.x-1.x
    Issue #2922774 by jhodgdon, andypost: Update URL patterns to match...
jhodgdon’s picture

Title: Decide about path patterns to manage topics » Update URL patterns to match config standard
Status: Needs review » Fixed
Related issues: +#2920309: Add experimental module for Help Topics

OK, I will go ahead and commit this to the sandbox, update the Core patch on parent issue, and let you deal with the 4 lines removal, since you are working on autocomplete, OK?

Thanks for the quick review!

jhodgdon’s picture

We can't add a test for the "add" machine name until those 4 lines go away in the Form class... I'm not too worried about it though, it's kind of an edge case.

Status: Fixed » Closed (fixed)

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