Skip to content
Snippets Groups Projects
Verified Commit 57ef3662 authored by quietone's avatar quietone
Browse files

Issue #2479449 by sudiptadas19, smustgrave, akashkumar07, rithesh bk, rpayanm,...

Issue #2479449 by sudiptadas19, smustgrave, akashkumar07, rithesh bk, rpayanm, pradhumanjain2311, tstoeckler, mrinalini9, tatisilva, larowlan, andypost, dawehner, xjm, yesct: contact_menu_local_tasks_alter() should check whether ['tabs'][0] is set

(cherry picked from commit 833e599d)
parent ffffbf3c
No related branches found
No related tags found
6 merge requests!10602Issue #3438769 by vinmayiswamy, antonnavi, michelle, amateescu: Sub workspace does not clear,!10301Issue #3469309 by mstrelan, smustgrave, moshe weitzman: Use one-time login...,!10187Issue #3487488 by dakwamine: ExtensionMimeTypeGuesser::guessMimeType must support file names with "0" (zero) like foo.0.zip,!6502Draft: Resolve #2938524 "Plach testing issue",!38582585169-10.1.x,!3226Issue #2987537: Custom menu link entity type should not declare "bundle" entity key
Pipeline #319071 passed with warnings
Pipeline: drupal

#319139

    Pipeline: drupal

    #319123

      Pipeline: drupal

      #319120

        +6
        ......@@ -98,7 +98,7 @@ function contact_entity_extra_field_info() {
        * email address configured.
        */
        function contact_menu_local_tasks_alter(&$data, $route_name) {
        if ($route_name == 'entity.user.canonical') {
        if ($route_name == 'entity.user.canonical' && isset($data['tabs'][0])) {
        foreach ($data['tabs'][0] as $href => $tab_data) {
        if ($href == 'entity.user.contact_form') {
        $link_params = $tab_data['#link']['url']->getRouteParameters();
        ......
        <?php
        declare(strict_types=1);
        namespace Drupal\Tests\contact\Unit;
        use Drupal\Tests\UnitTestCase;
        /**
        * @group contact
        */
        class ContactTest extends UnitTestCase {
        /**
        * Test contact_menu_local_tasks_alter doesn't throw warnings.
        */
        public function testLocalTasksAlter(): void {
        require_once $this->root . '/core/modules/contact/contact.module';
        $data = [];
        \contact_menu_local_tasks_alter($data, 'entity.user.canonical');
        $this->assertTrue(TRUE, 'No warning thrown');
        }
        }
        0% Loading or .
        You are about to add 0 people to the discussion. Proceed with caution.
        Finish editing this message first!
        Please register or to comment