Skip to content
Snippets Groups Projects
Verified Commit 7bf99407 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 9b7d24a6
No related branches found
No related tags found
11 merge requests!13092Issue #3498963 by benjifisher, heddn: Add lookup_migrations configuration to...,!12802Issue #3537193 by opauwlo: Add enable absolute path option for CKEditor5 image uploads,!12745Fixed: Path alias language doesn't changes on changing of node language,!12684Issue #3220784,!12537Add ViewsConfigUpdater deprecation support for default_argument_skip_url,!12523Issue #3493858 by vidorado, xavier.masson, smustgrave: Extend ViewsBlockBase...,!122353526426-warning-for-missing,!11958Issue #3490507 by alexpott, smustgrave: Fix bogus mocking in...,!11769Issue #3517987: Add option to contextual filters to encode slashes in query parameter.,!11185Issue #3477324 by andypost, alexpott: Fix usage of str_getcsv() and fgetcsv() for PHP 8.4,!9944Issue #3483353: Consider making the createCopy config action optionally fail...
Pipeline #318965 passed with warnings
Pipeline: drupal

#319007

    Pipeline: drupal

    #318999

      Pipeline: drupal

      #318996

        +7
        ......@@ -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.
        Please to comment