Skip to content
Snippets Groups Projects
Verified Commit 0a6b5691 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 cdc0427b
No related branches found
No related tags found
6 merge requests!10663Issue #3495778: Update phpdoc in FileSaveHtaccessLoggingTest,!10451Issue #3472458 by watergate, smustgrave: CKEditor 5 show blocks label is not translated,!10150Issue #3467294 by quietone, nod_, smustgrave, catch, longwave: Change string...,!10130Resolve #3480321 "Second level menu",!9936Issue #3483087: Check the module:// prefix in the translation server path and replace it with the actual module path,!9933Issue #3394728 by ankondrat4: Undefined array key "#prefix" and deprecated function: explode() in Drupal\file\Element\ManagedFile::uploadAjaxCallback()
Pipeline #319911 passed
Pipeline: drupal

#319912

    ......@@ -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