- π³π±Netherlands ricovandevin
What I have also noticed is that the link in the message is going to the
entity_usage.usage_list route
while the local tab is going to theentity.$entity_type_id.entity_usage
route. The former does not show the other tabs for the entity and the link opens in a new browser tab making it hard to browse back. - Open on Drupal.org βCore: 10.1.x + Environment: PHP 8.1 & MySQL 8last update
about 1 year ago Waiting for branch to pass - Status changed to Needs review
about 1 year ago 1:35pm 14 December 2023 - Open on Drupal.org βCore: 10.1.x + Environment: PHP 8.1 & MySQL 8last update
about 1 year ago Waiting for branch to pass - π³π±Netherlands ricovandevin
MR adds config fields for the edit and delete warning messages. It also adds two tokens that can be used the display then entity's bundle name and the URL to the usage page for the entity (the version with the tabs).
Patch attached for Composer based workflows.
- Status changed to Needs work
8 months ago 3:54pm 19 April 2024 - πΊπΈUnited States justcaldwell Austin, Texas
This would be a nice improvement! #6 works for me on content entities (nodes), but fails on Media entities with:
Error: Call to a member function label() on null in entity_usage_tokens() (line 200 of modules/contrib/entity_usage/entity_usage.module). call_user_func_array(Object, Array) (Line: 409) Drupal\Core\Extension\ModuleHandler->Drupal\Core\Extension\{closure}(Object, 'entity_usage') (Line: 388) Drupal\Core\Extension\ModuleHandler->invokeAllWith('tokens', Object) (Line: 408) Drupal\Core\Extension\ModuleHandler->invokeAll('tokens', Array) (Line: 364) Drupal\Core\Utility\Token->generate('entity-usage', Array, Array, Array, Object) (Line: 241) Drupal\Core\Utility\Token->doReplace(1, 'Changing this [entity-usage:entity-bundle] will affect <a href="usage-url]" target="_blank">everywhere it appears</a>. Alternatively, remove this [entity-usage:entity-bundle] from the original content and add a new one.', Array, Array, Object) (Line: 191) Drupal\Core\Utility\Token->replace('Changing this [entity-usage:entity-bundle] will affect <a href="usage-url]" target="_blank">everywhere it appears</a>. Alternatively, remove this [entity-usage:entity-bundle] from the original content and add a new one.', Array, Array, NULL) (Line: 18) Drupal\token_or\Token->replace('Changing this [entity-usage:entity-bundle] will affect <a href="usage-url]" target="_blank">everywhere it appears</a>. Alternatively, remove this [entity-usage:entity-bundle] from the original content and add a new one.', Array) (Line: 117) entity_usage_form_alter(Array, Object, 'media_image_edit_form') (Line: 545) Drupal\Core\Extension\ModuleHandler->alter('form', Array, Object, 'media_image_edit_form') (Line: 841) Drupal\Core\Form\FormBuilder->prepareForm('media_image_edit_form', Array, Object) (Line: 284) Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 73) Drupal\Core\Controller\FormController->getContentResult(Object, Object) (Line: 39) Drupal\layout_builder\Controller\LayoutBuilderHtmlEntityFormController->getContentResult(Object, Object) call_user_func_array(Array, Array) (Line: 123) Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 627) Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 121) Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97) Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 181) Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 76) Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58) Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48) Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 28) Drupal\Core\StackMiddleware\ContentLength->handle(Object, 1, 1) (Line: 106) Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85) Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48) Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51) Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 36) Drupal\Core\StackMiddleware\AjaxPageState->handle(Object, 1, 1) (Line: 51) Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 704) Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
- Status changed to Needs review
8 months ago 4:02pm 19 April 2024 - πΊπΈUnited States justcaldwell Austin, Texas
The construct
$entity->type->entity->label()
may not be reliable across entity types. The latest change makes use of theentity_type.bundle.info
service to fetch the label instead. Back to NR.