Skip to content
Snippets Groups Projects

Resolve #3487705 "Refactor banuserform"

3 unresolved threads

Closes #3487705

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
89 89 /**
90 90 * {@inheritdoc}
91 91 */
92 public function buildForm(array $form, FormStateInterface $form_state, $target_id = NULL): array {
  • 117 '#title' => $this->t('Blocked User'),
    118 '#default_value' => $target_id,
    119 '#required' => FALSE,
    96 '#title' => $this->t('Select User'),
    97 '#required' => TRUE,
    98 '#type' => 'entity_autocomplete',
    99 '#target_type' => 'user',
    100 '#tags' => FALSE,
    101 '#selection_handler' => 'private_message:not_blocked_user',
    102 '#selection_settings' => [
    103 'include_anonymous' => FALSE,
    104 ],
    120 105 ];
    121 106
    122 $submitLabel = $config->get('ban_label');
    123 if ($target_id && $this->privateMessageBanManager->isBanned($target_id)) {
  • 244 241 return $response;
    245 242 }
    246 243
    247 /**
    248 * Handler for autocomplete request for banning people.
    249 */
    250 public function privateMessageBanMembersAutocomplete(Request $request) {
    251 $results = [];
    252
    253 if ($input = $request->query->get('q')) {
    254 $typed_string = Tags::explode($input);
    255 $typed_string = mb_strtolower(array_pop($typed_string));
    256 $accounts = $this->privateMessageService->getUsersFromString($typed_string, self::AUTOCOMPLETE_COUNT);
    257
    258 foreach ($accounts as $account) {
    259 if (!$this->privateMessageBanManager->isBanned($account->id())) {
  • Adrian Lorenc added 1 commit

    added 1 commit

    Compare with previous version

  • Claudiu Cristea
  • added 1 commit

    • 97adc98c - Declare strict types in the new file

    Compare with previous version

  • Claudiu Cristea approved this merge request

    approved this merge request

  • Claudiu Cristea added 7 commits

    added 7 commits

    Compare with previous version

  • Please register or sign in to reply
    Loading