It would appear the patch fails to work on any version of 10.3.*. I didn't bother testing 10.2 and below.
codesquatch β created an issue.
Ahhh, thank you! I see now, that makes sense. Appreciate you dropping the code example too, you da bomb!
Ah, thanks for the response. Oh of curiosity, how would one use this forked version on a production environment? Iβm used to using cweagans patches in composer to maintain things of this nature.
Unfortunately #112 is failing against 10.2 :/
@MukhtarM It could have been an oversight on the implementing developer, or perhaps an assumption that the update would always file since the module would only be supported on D8/9? Either way, installing the module on fresh D9 and D10 (with patch) site throws the error for me that is in the description of the bug. It was causing a headache in situations where the module is a dependency for a distribution.
I just ran across the issue as well so I created a patch for it.
To answer your additional question @kaelteschutzgebiet, you'd need to add it into the User Profile page yourself via an alter hook or preprocess hook in your theme. This is how we've done it:
/**
* Implements hook_ENTITY_TYPE_view_alter() for user entities.
*
* This function adds the user's API Token to their profile form.
*/
function modulename_user_view_alter(array &$build, UserInterface $account, EntityViewDisplayInterface $display): void {
// Display API Token for current user.
if ($account->id() === \Drupal::currentUser()->id()) {
$token = \Drupal::database()
->select(Token::TABLE_NAME, 't')
->fields('t', ['public_token'])
->condition('user_id', $account->id())
->execute()
->fetch();
$build['api_token'] = [
'#type' => 'item',
'#title' => t('API Session Token'),
'#label_attributes' => ['class' => ['label']],
'#plain_text' => $token?->public_token ?? '',
];
}
}
The package has been updated to properly set all module dependencies. This change has been added to https://www.drupal.org/project/wsdl_docs/releases/4.0.0 β
This patch has been merged into core and released in https://www.drupal.org/project/wsdl_docs/releases/4.0.0 β
This patch has been merged into core and released in https://www.drupal.org/project/wsdl_docs/releases/4.0.0 β
D10 support has been added in https://www.drupal.org/project/wsdl_docs/releases/4.0.0 β