- Issue was unassigned.
- Status changed to Needs work
5 months ago 1:01pm 6 August 2024 - 🇺🇸United States mlncn Minneapolis, MN, USA
Patch does not apply, probably only needs minor re-roll.
I see it disables the action links for form mode manager globally. This is probably a useful option but personally i would go for being able to hide or rename any specific action or operations link generated by Form mode manager, if i were to take this on. But a couple of alter hooks makes that possible too.
In an `example.module` file in your custom Example module— presuming you are not using bundle subclasses for your content, the ProgramApplication parts can be dropped and this will still work:
use Drupal\example\Entity\ProgramApplication; /** * Implements hook_menu_local_actions_alter(). */ function example_menu_local_actions_alter(&$local_actions) { // Remove "Create as" link for the content form mode 'form_mode_edit_only'. unset($local_actions['form_mode_manager.action:node.form_mode_edit_only']); // Shorten "Create content as form_mode" link to "Create form mode". $local_actions['form_mode_manager.action:node.application_forms']['title'] = t("Create application forms"); } /** * Implements hook_entity_operation_alter(). */ function example_entity_operation_alter(&$operations, $entity) { if ($entity instanceof ProgramApplication and isset($operations['application_forms'])) { // Shorten the edit link e.g. it the per-node dropdown on the content admin listing page. $operations['application_forms']['title'] = t("Edit application forms"); } }