- Issue created by @bmango
- First commit to issue fork.
- 🇮🇳India vinmayiswamy
Hi, I have created MR!17 for this feature request. This MR introduces updates to the front_page module's configuration form. The changes focus on improving the handling of token replacements in redirect paths and enhancing the codebase by following Drupal best practices.
Key Changes
Token Integration:
- Added support for token replacement in the front page path settings. Users can now use tokens like[node:title]
in the path fields, and these tokens will be replaced correctly when saving the settings.Form Enhancements:
- Added token help to all path fields to guide users on using tokens effectively.
- Improved form validation to ensure that a path is provided when redirection is enabled for a role.
- Integrated token help UI usingtoken_tree_link
to assist users with token insertion.Code Quality and Refactoring:
- Refactored code to use dependency injection instead of direct service calls (\Drupal::service()
,\Drupal::moduleHandler()
, etc.).
- Cleaned up deprecated code and improved overall readability.Testing Instructions
Verify Token Functionality:
- Ensure that token help is visible and functional for all path fields in the configuration form.
- Confirm that tokens in paths are replaced correctly when the form is submitted.Form Validation:
- Validate that errors are displayed if a path is missing for roles with redirection enabled.Code Quality:
- Verify that the code uses dependency injection properly and that deprecated service calls have been replaced.Additional Notes
- Ensure that the Token → module is enabled to fully test token-related functionality.
- Review changes for any potential impact on other modules or configurations.Thanks!
- Status changed to Needs review
6 months ago 7:29am 30 July 2024 - 🇧🇪Belgium flyke
Patch does not apply in 10.0@alpha2, BUT, I tested using a token in /admin/config/system/front/home-links and it works without a patch.