Problem

Since #3616524: Translate the resource name, the slot title and the tariff label a booker reads every translatable engine entity type carries a canonical link template pointing at its edit form, so that core's translation screens have something to hang off. Two things follow from that which were not seen:

  • Core's route provider builds a canonical route from that template, and the route it builds renders the entity through its view builder. Every content entity type has a view builder by default, and these entities have no view display, so the edit screen of ten entity types answered with a heading, tabs and no form.
  • A local task belongs to a route name, and the new template put a second name on the edit form's path. The name that is served is the canonical one, so the tabs that name the edit form left the screen: Slots, Tariffs, Bookings, Allotments, Managers and Rules on a resource.
  • A translation form showed what it does not translate. Core hides every element of such a form that is not multilingual, but it does that in a form alter of its own, and the engine adds the inherit boxes and the read-only sentences after it has run. Four field groups whose every row had been taken away then stood empty.

Testing those fixes turned up five faults of the same kind, none of them new:

  • Every value on the Tariffs tab rendered one or two columns from the heading that names it. A row of that table is a form element, so its cells render in the order they were added; both modules that fill the column seam put their heading before Operations and add their cell at the end of the row.
  • Saving a slot went to the site-wide list of every slot of every resource, so an operator working through one production's dates lost their place on every save.
  • Six records exist to attach one thing to another, and each of their forms asked for what owns the row by autocomplete over the whole site. That is not an edit: it is how the row was reached.
  • The breadcrumb could not say what owns a record, because the paths are flat, so every one of these screens read Home, Administration, Resource tariffs.
  • Twelve entity types carry a weight an operator sets by dragging, and every reference widget ignored it, because the selection handler sorts alphabetically.

Proposed resolution

The canonical route becomes the edit-form route itself, which is what core's menu_link_content does for the one entity type of its own in the same position: two routes on one path have to be interchangeable. The route subscriber that titles these forms reaches both names, and the local tasks of such a screen are moved to the name that is served.

On a translation form, what the engine adds beside an untranslatable field is taken away with it, and a field group is judged empty by asking each row and sentence rather than by counting them.

The rest follows what the records already are: cells are sorted by the header, so a column added later is right without saying anything about position; the owning reference is shown rather than asked, with the widget left in place and inaccessible so the reference still round-trips on save; the breadcrumb walks the ownership chain; saving returns to the tab the record is listed on; and weighted records are offered in weight order in every select, decided once from the target type rather than per field.

Remaining tasks

Drag-and-drop ordering on the weighted lists that do not yet have it, and the hand-built selects in the custom forms, are being handled separately.

User interface changes

The edit screen of a translatable record shows its form and its whole tab bar again. A translation form asks only what it translates. A tariff's values line up with their headings. Breadcrumbs on these screens offer the way back to the resource, the slot or the preset. Selects offer weighted records in the order they were weighted.

API changes

None.

Data model changes

None.

AI-Generated: Yes (the code, its tests and this summary were written by Claude Opus, reviewed and verified by the maintainer against a running site)

Issue fork yoyaku-3618261

Command icon 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

mably created an issue. See original summary.

mably’s picture

Status: Active » Needs review

  • mably committed e5b39a4b on 1.x
    fix: #3618261 The admin screens of a translatable record lost their form...
mably’s picture

Status: Needs review » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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