Add more social media event doesn't match dispatched event

Created on 13 May 2020, over 4 years ago
Updated 11 May 2023, over 1 year ago

The event name provided in the .api file and the module page doesn't correspond to the one dispatched by the module code.

Drupal\social_media\Form\SocialMediaAdminForm::getSocialMedias(), event dispatched : 'social_media.add_more_link'.

In the api file and the module page, event name = 'social_media.add_more_social_media'

I'd say that add_more_social_media is a more relevant name than add_more_link, so I'd update the event name in the dispatcher.

📌 Task
Status

Needs review

Version

2.0

Component

Code

Created by

🇭🇷Croatia Aporie

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇺🇸United States luke.leber Pennsylvania
    +++ b/src/Form/SocialMediaAdminForm.php
    @@ -257,7 +257,7 @@ class SocialMediaAdminForm extends ConfigFormBase {
    -    $this->eventDispatcher->dispatch('social_media.add_more_link', $event);
    +    $this->eventDispatcher->dispatch('social_media.add_more_social_media', $event);
    

    Ouch! For B/C reasons, I think we need to keep both of the events for now.

    Also, the order needs to be switched around to be compatible with D9/D10 :-)

    // @deprecated - will be removed at some point in the future
    $this->eventDispatcher->dispatch($event, 'social_media.add_more_link');
    
    $this->eventDispatcher->dispatch($event, 'social_media.add_more_social_media');
    
  • Status changed to Active over 1 year ago
  • Issue was unassigned.
  • Status changed to Needs review over 1 year ago
  • Attaching the patch.

  • 🇺🇸United States luke.leber Pennsylvania
Production build 0.71.5 2024