I've just spent hours trying to find out where the extra slash after my domain came from. Please specify in the help/info text for the "Language domain" field that there should be no trailing slash.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Jose Reyero’s picture

Project: Internationalization » Drupal core
Version: 6.x-1.0 » 6.x-dev
Component: Documentation » language system

This is Drupal core.

Gábor Hojtsy’s picture

Version: 6.x-dev » 8.x-dev
Category: task » bug

It should also validate for it IMHO.

jhedstrom’s picture

Issue summary: View changes

Well, this no longer is allowed, but the following exception is thrown when adding a trailing slash:

Recoverable fatal error: Object of class Drupal\Core\Language\Language could not be converted to string in Drupal\Component\Utility\SafeMarkup::isSafe() (line 94 of core/lib/Drupal/Component/Utility/SafeMarkup.php).
Drupal\Component\Utility\SafeMarkup::isSafe(Object)
Drupal\Component\Utility\SafeMarkup::escape(Object)
Drupal\Component\Utility\SafeMarkup::placeholder(Object)
Drupal\Component\Utility\SafeMarkup::format('The domain for %language may only contain the domain name, not a protocol and/or port.', Array)
Drupal\Core\StringTranslation\TranslationManager->translate('The domain for %language may only contain the domain name, not a protocol and/or port.', Array, Array)
Drupal\Core\Form\FormBase->t('The domain for %language may only contain the domain name, not a protocol and/or port.', Array)
Drupal\language\Form\NegotiationUrlForm->validateForm(Array, Object)
call_user_func_array(Array, Array)
Drupal\Core\Form\FormValidator->executeValidateHandlers(Array, Object)
Drupal\Core\Form\FormValidator->doValidateForm(Array, Object, 'language_negotiation_configure_url_form')
Drupal\Core\Form\FormValidator->validateForm('language_negotiation_configure_url_form', Array, Object)
Drupal\Core\Form\FormBuilder->processForm('language_negotiation_configure_url_form', Array, Object)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object)
Drupal\Core\Controller\FormController->getContentResult(Object, Object)
call_user_func_array(Array, Array)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1)
Drupal\Core\DependencyInjection\Container\prod\Symfony_Component_HttpKernel_HttpKernel_Proxy->handle(Object, 1, 1)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1)
Drupal\Core\DependencyInjection\Container\prod\Drupal_Core_StackMiddleware_Session_Proxy->handle(Object, 1, 1)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1)
Drupal\Core\DependencyInjection\Container\prod\Drupal_Core_StackMiddleware_KernelPreHandle_Proxy->handle(Object, 1, 1)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1)
Stack\StackedHttpKernel->handle(Object, 1, 1)
Drupal\Core\DrupalKernel->handle(Object)
jhedstrom’s picture

Status: Active » Needs review
FileSize
1.26 KB

This fixes the fatal error, and adds a mention of not using a trailing slash to the error message.

mmatsoo’s picture

Assigned: Unassigned » mmatsoo
mmatsoo’s picture

Assigned: mmatsoo » Unassigned
Status: Needs review » Reviewed & tested by the community
FileSize
97.33 KB

Tested patch and it worked as expected. Fatal error gone and text added to tell user not to use trailing slash.

Screenshot of issue 452244 showing update error message.

alexpott’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs tests

Looks like we should have a test for this given Recoverable fatal error: Object of class Drupal\Core\Language\Language could not be converted to string.

jhedstrom’s picture

Assigned: Unassigned » jhedstrom

I'll write a test.

jhedstrom’s picture

Assigned: jhedstrom » Unassigned
Status: Needs work » Needs review
Issue tags: -Needs tests
FileSize
1.11 KB
1.11 KB
2.37 KB

This adds a test to ensure the form properly detects invalid domains.

The last submitted patch, 9: language-domain-form-452244-09-TEST-ONLY.patch, failed testing.

Gábor Hojtsy’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: +D8MI, +language-base, +sprint

Looks good to me.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

This issue is a normal bug fix, and doesn't include any disruptive changes, so it is allowed per https://www.drupal.org/core/beta-changes. Committed c471f0f and pushed to 8.0.x. Thanks!

  • alexpott committed c471f0f on 8.0.x
    Issue #452244 by jhedstrom: Help text for Language domain needs to...
Gábor Hojtsy’s picture

Issue tags: -sprint

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.