In the documentation "social_media.add_more_social_media" must be replaced by "social_media.add_more_link".
The same mistake is in the social_media.api.php example file.
Thank you.

Comments

filipposcarselli created an issue. See original summary.

bhanuprakashnani’s picture

There is no difference between "social_media.add_more_social_media" and "social_media.add_more_social_media". Did I understand it wrong?

filipposcarselli’s picture

Sorry for my mistake. In the documentation "social_media.add_more_social_media" must be replaced by "social_media.add_more_link".
The same in social_media.api.php :

public static function getSubscribedEvents() {
$events = array();
$events['social_media.add_more_social_media'][] = array('addMoreSocialMedia', 39);
$events['social_media.pre_execute'][] = array('pre_executeSocialMedia', 39);
$events['social_media.pre_render'][] = array('pre_rednerSocialMedia', 39);

return $events;
}

public static function getSubscribedEvents() {
$events = array();
$events['social_media.add_more_link'][] = array('addMoreSocialMedia', 39);
$events['social_media.pre_execute'][] = array('pre_executeSocialMedia', 39);
$events['social_media.pre_render'][] = array('pre_rednerSocialMedia', 39);

return $events;
}

bhanuprakashnani’s picture

Assigned: Unassigned » bhanuprakashnani
Status: Active » Needs review
StatusFileSize
new1.04 KB

Made the needed changes. Please review.

Anonymous’s picture

Using this patch, I was able to create a module that adds Diaspora as a service that can be used for sharing.

I use the following settings:

API URL:
http://sharetodiaspora.github.io/?title=[current-page:title]&url=[curren...

Alternative image link:
/modules/custom/social_media_diaspora/icons/diaspora.svg

Anonymous’s picture

StatusFileSize
new16.79 KB
Anonymous’s picture

Title: documentation to be corrected » API and documentation to be corrected ("social_media.add_more_social_media" must be replaced by "social_media.add_more_link")
Component: Documentation » Code

This is not just about documentation, but an important correction to the API.

bhanuprakashnani’s picture

Review, please?

bhanuprakashnani’s picture

Can someone look forward into this issue?

msankhala’s picture

Issue summary: View changes
msankhala’s picture

@Andreas Speck This issue is not the correct place to share about your custom module.

msankhala’s picture

Status: Needs review » Needs work

Changes look good. There is one more place where it should be renamed. docblock of addMoreSocialMedia() method in api.php file.

  /**
   * Subscribes to  social_media.add_more_social_media event.
   *
   */
  public function addMoreSocialMedia($event) {
bhanuprakashnani’s picture

Status: Needs work » Needs review
StatusFileSize
new1.31 KB

Changed it where mentioned. Please review and mention if any more changes are to be made. Thank you.

msankhala’s picture

Status: Needs review » Reviewed & tested by the community

Changes look good. Patch #13 applies cleanly and fixes the issue with dispatch event social_media.add_more_link documentation.

bhanuprakashnani’s picture

Please give the fixed tag to this issue.

scuba_fly’s picture

Status: Reviewed & tested by the community » Needs work

Makes sense to rename this.

Have to look if this changes is backwords compatible since API change was mentioned.

+++ b/social_media.api.php
@@ -17,7 +17,7 @@ class socialMediaSubscriber implements EventSubscriberInterface {
-    $events['social_media.add_more_social_media'][] = array('addMoreSocialMedia', 39);

When fixing an issue we should apply the coding standards. This uses the old array() syntax. We should use the new [] array syntax for drupal 8 modules.

scuba_fly’s picture

Assigned: bhanuprakashnani » Unassigned

Unassigning this, since it is an old issue. Feel free to reassign it when you work on this.

avpaderno’s picture

Version: 8.x-1.3 » 8.x-1.x-dev
Issue tags: -Documentation
rithesh bk’s picture

Assigned: Unassigned » rithesh bk
Issue tags: +VbContribution2020

we will work on VbContribution2020

dhirendra.mishra’s picture

Working on this.

dhirendra.mishra’s picture

Assigned: dhirendra.mishra » Unassigned
Status: Needs work » Needs review
StatusFileSize
new1.31 KB

I have updated the patch from scratch as #13 was not applying to me.

Please review the patch.