Loading core/modules/user/src/Plugin/LanguageNegotiation/LanguageNegotiationUserAdmin.php +3 −6 Original line number Diff line number Diff line Loading @@ -10,8 +10,8 @@ use Drupal\Core\Routing\RouteObjectInterface; use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException; use Symfony\Component\Routing\Exception\ResourceNotFoundException; use Symfony\Component\HttpKernel\Exception\HttpException; use Symfony\Component\Routing\Exception\ExceptionInterface; use Symfony\Component\Routing\Matcher\UrlMatcherInterface; /** Loading Loading @@ -137,10 +137,7 @@ protected function isAdminPath(Request $request) { $path = $this->pathProcessorManager->processInbound(urldecode(rtrim($cloned_request->getPathInfo(), '/')), $cloned_request); $attributes = $this->router->match($path); } catch (ResourceNotFoundException $e) { return FALSE; } catch (AccessDeniedHttpException $e) { catch (ExceptionInterface | HttpException) { return FALSE; } $route_object = $attributes[RouteObjectInterface::ROUTE_OBJECT]; Loading core/modules/user/tests/modules/user_language_test/src/Controller/UserLanguageTestController.php 0 → 100644 +17 −0 Original line number Diff line number Diff line <?php namespace Drupal\user_language_test\Controller; /** * Returns responses for User Language Test routes. */ class UserLanguageTestController { /** * Builds the response. */ public function buildPostResponse() { return ['#markup' => 'It works!']; } } core/modules/user/tests/modules/user_language_test/src/Form/UserLanguageTestForm.php 0 → 100644 +46 −0 Original line number Diff line number Diff line <?php namespace Drupal\user_language_test\Form; use Drupal\Core\Form\FormBase; use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Url; /** * Provides a User Language Test form. */ class UserLanguageTestForm extends FormBase { /** * {@inheritdoc} */ public function getFormId() { return 'user_language_test'; } /** * {@inheritdoc} */ public function buildForm(array $form, FormStateInterface $form_state) { $form['#action'] = Url::fromRoute('user_language_test.post_response')->toString(); $form['actions'] = [ '#type' => 'actions', 'submit' => [ '#type' => 'submit', '#value' => $this->t('Send'), ], ]; return $form; } /** * {@inheritdoc} */ public function submitForm(array &$form, FormStateInterface $form_state) { } } core/modules/user/tests/modules/user_language_test/user_language_test.info.yml 0 → 100644 +5 −0 Original line number Diff line number Diff line name: 'User language tests' type: module description: 'Support module for user language testing.' package: Testing version: VERSION core/modules/user/tests/modules/user_language_test/user_language_test.routing.yml 0 → 100644 +16 −0 Original line number Diff line number Diff line user_language_test.post_response: path: '/user-language-test/post' defaults: _controller: Drupal\user_language_test\Controller\UserLanguageTestController::buildPostResponse methods: [post] options: _admin_route: TRUE requirements: _access: 'TRUE' user_language_test.form: path: '/user-language-test/form' defaults: _form: 'Drupal\user_language_test\Form\UserLanguageTestForm' requirements: _access: 'TRUE' Loading
core/modules/user/src/Plugin/LanguageNegotiation/LanguageNegotiationUserAdmin.php +3 −6 Original line number Diff line number Diff line Loading @@ -10,8 +10,8 @@ use Drupal\Core\Routing\RouteObjectInterface; use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException; use Symfony\Component\Routing\Exception\ResourceNotFoundException; use Symfony\Component\HttpKernel\Exception\HttpException; use Symfony\Component\Routing\Exception\ExceptionInterface; use Symfony\Component\Routing\Matcher\UrlMatcherInterface; /** Loading Loading @@ -137,10 +137,7 @@ protected function isAdminPath(Request $request) { $path = $this->pathProcessorManager->processInbound(urldecode(rtrim($cloned_request->getPathInfo(), '/')), $cloned_request); $attributes = $this->router->match($path); } catch (ResourceNotFoundException $e) { return FALSE; } catch (AccessDeniedHttpException $e) { catch (ExceptionInterface | HttpException) { return FALSE; } $route_object = $attributes[RouteObjectInterface::ROUTE_OBJECT]; Loading
core/modules/user/tests/modules/user_language_test/src/Controller/UserLanguageTestController.php 0 → 100644 +17 −0 Original line number Diff line number Diff line <?php namespace Drupal\user_language_test\Controller; /** * Returns responses for User Language Test routes. */ class UserLanguageTestController { /** * Builds the response. */ public function buildPostResponse() { return ['#markup' => 'It works!']; } }
core/modules/user/tests/modules/user_language_test/src/Form/UserLanguageTestForm.php 0 → 100644 +46 −0 Original line number Diff line number Diff line <?php namespace Drupal\user_language_test\Form; use Drupal\Core\Form\FormBase; use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Url; /** * Provides a User Language Test form. */ class UserLanguageTestForm extends FormBase { /** * {@inheritdoc} */ public function getFormId() { return 'user_language_test'; } /** * {@inheritdoc} */ public function buildForm(array $form, FormStateInterface $form_state) { $form['#action'] = Url::fromRoute('user_language_test.post_response')->toString(); $form['actions'] = [ '#type' => 'actions', 'submit' => [ '#type' => 'submit', '#value' => $this->t('Send'), ], ]; return $form; } /** * {@inheritdoc} */ public function submitForm(array &$form, FormStateInterface $form_state) { } }
core/modules/user/tests/modules/user_language_test/user_language_test.info.yml 0 → 100644 +5 −0 Original line number Diff line number Diff line name: 'User language tests' type: module description: 'Support module for user language testing.' package: Testing version: VERSION
core/modules/user/tests/modules/user_language_test/user_language_test.routing.yml 0 → 100644 +16 −0 Original line number Diff line number Diff line user_language_test.post_response: path: '/user-language-test/post' defaults: _controller: Drupal\user_language_test\Controller\UserLanguageTestController::buildPostResponse methods: [post] options: _admin_route: TRUE requirements: _access: 'TRUE' user_language_test.form: path: '/user-language-test/form' defaults: _form: 'Drupal\user_language_test\Form\UserLanguageTestForm' requirements: _access: 'TRUE'