By br0ken on
Change record status:
Published (View all published change records)
Project:
Introduced in branch:
8.x-2.x
Introduced in version:
8.x-2.x-dev
Issue links:
Description:
-
Replace
hook_sdk_types()by@Sdkannotation.Before
sdk_facebook.module/** * Implements hook_sdk_types(). */ function sdk_facebook_sdk_types() { $types = []; $types['facebook'] = [ 'label' => t('Facebook'), 'classes' => [ 'form' => FacebookForm::class, 'deriver' => FacebookDeriver::class, ], ]; return $types; }After
src/Plugin/Sdk/Facebook.phpnamespace Drupal\sdk_facebook\Plugin\Sdk; use Drupal\sdk\SdkPluginBase; use Facebook\Facebook as FacebookSdk; /** * SDK definition. * * @Sdk( * id = "facebook", * label = @Translation("Facebook"), * ) */ class Facebook extends SdkPluginBase { }src/Plugin/Sdk/FacebookConfigurationForm.php(theConfigurationFormappends to the name of SDK class)namespace Drupal\sdk_facebook\Plugin\Sdk; use Drupal\Core\Form\FormStateInterface; use Drupal\sdk\SdkPluginConfigurationFormBase; /** * Form for SDK configuration. */ class FacebookConfigurationForm extends SdkPluginConfigurationFormBase { } -
Replace
sdk_deriver($type)by\Drupal::service('plugin.manager.sdk')->createInstance($type) -
Replace
sdk_types()by\Drupal::service('plugin.manager.sdk')->getDefinitions() -
Replace usage of
\Drupal\sdk\Api\ExternalLinkby\Drupal\sdk\ExternalLink
Impacts:
Site builders, administrators, editors
Module developers