Improve labeling and behavior of the file name field when cloning a tour

Created on 3 October 2024, 2 months ago

Problem/Motivation

Raised the points in #3465646-10: Merge in functionality from the Tour Builder module โ†’ , there are currently two problems with the clone functionality:

The field label File name for new tour item. is lengthy and in the sentence case and "sort" of misleading. the field IS about the file name with tour.tour prepended, but at the same time the field alone is equal to the machine_name. and the description for the file name field is also "sort" of confusing with This value should start with tour.tour. and may not exist., the "may" not exist is the confusing detail. may leaves a few questionmarks above the head (just noticed the description now taking a closer look) .

the file name/machine name is the more serious problem. machine names have to be lowercase with no spaces nor special characters. If I try Appearance TEST page it is getting accepted and i get:

out of curiosity i then went ahead and tried to add a special character: Appearance TEST page ?. with that i run into a WSOD (with an emoji that error gets even more lengthy and complex):

The website encountered an unexpected error. Try again later.

Drupal\Core\Config\ConfigNameException: Invalid character in Config object name tour.tour.appearance TEST page ?. in Drupal\Core\Config\ConfigBase::validateName() (line 107 of core/lib/Drupal/Core/Config/ConfigBase.php).
Drupal\Core\Config\Config->save() (Line: 260)
Drupal\Core\Config\Entity\ConfigEntityStorage->doSave() (Line: 486)
Drupal\Core\Entity\EntityStorageBase->save() (Line: 239)
Drupal\Core\Config\Entity\ConfigEntityStorage->save() (Line: 354)
Drupal\Core\Entity\EntityBase->save() (Line: 617)
Drupal\Core\Config\Entity\ConfigEntityBase->save() (Line: 69)
Drupal\tour\Form\TourCloneForm->submitForm()
call_user_func_array() (Line: 105)
Drupal\Core\Form\FormSubmitter->executeSubmitHandlers() (Line: 43)
Drupal\Core\Form\FormSubmitter->doSubmitForm() (Line: 589)
Drupal\Core\Form\FormBuilder->processForm() (Line: 321)
Drupal\Core\Form\FormBuilder->buildForm() (Line: 73)
Drupal\Core\Controller\FormController->getContentResult() (Line: 39)
Drupal\layout_builder\Controller\LayoutBuilderHtmlEntityFormController->getContentResult() (Line: 80)
Drupal\workspaces\Controller\WorkspacesHtmlEntityFormController->getContentResult()
call_user_func_array() (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 593)
Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 121)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext() (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 183)
Symfony\Component\HttpKernel\HttpKernel->handleRaw() (Line: 76)
Symfony\Component\HttpKernel\HttpKernel->handle() (Line: 53)
Drupal\Core\StackMiddleware\Session->handle() (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle() (Line: 28)
Drupal\Core\StackMiddleware\ContentLength->handle() (Line: 32)
Drupal\big_pipe\StackMiddleware\ContentLength->handle() (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass() (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle() (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() (Line: 36)
Drupal\Core\StackMiddleware\AjaxPageState->handle() (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle() (Line: 709)
Drupal\Core\DrupalKernel->handle() (Line: 19)

Steps to reproduce

clone a tour and add a new tour name and filename with spaces upper case letter and or special characters

Proposed resolution

i wonder if it would make sense to make the filename not directly editable and let the module handle the naming of the machine name/file name. machine names are required to be unique anyway, that way the file name description would become obsolete as well and with the automatic machine name creation procedure in other context it is taken care of that all characters are lower case with no space nor special characters?

Remaining tasks

User interface changes

API changes

Data model changes

๐Ÿ› Bug report
Status

Active

Version

2.0

Component

User interface

Created by

๐Ÿ‡ฉ๐Ÿ‡ชGermany rkoller Nรผrnberg, Germany

Live updates comments and jobs are added and updated live.
  • Usability

    Makes Drupal easier to use. Preferred over UX, D7UX, etc.

Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024