- Issue created by @Anybody
- Assigned to sourav_paul
- Issue was unassigned.
- Status changed to Needs review
3 months ago 12:54pm 6 August 2024 - Status changed to Needs work
3 months ago 1:25pm 6 August 2024 - ๐ฉ๐ชGermany Anybody Porta Westfalica
@Sourav_Paul tests still fail and there's a lot of work to do. Changing a word isn't a big deal here, sorry. But thank you anyway.
- Assigned to lrwebks
- Status changed to Needs review
about 2 months ago 8:51am 17 September 2024 - Status changed to Needs work
about 2 months ago 9:31pm 17 September 2024 - ๐ฉ๐ชGermany Anybody Porta Westfalica
@lrwebks thanks! Some points:
1. Pipeline is red, while it's green on the project page, that looks wrong?
2. Shouldn't the value be validated in the form? - ๐ฉ๐ชGermany lrwebks Porta Westfalica
@anybody regarding #9
- I'm looking into it right now
- The function
pathauto_pattern_validate()
from thepathauto.module
file is called from the form via the following line inPatternEditForm.php
:
'#element_validate' => ['token_element_validate', 'pathauto_pattern_validate'],
The other checks for missing tokens and whitespace at the end of the path were already placed in the
pathauto_pattern_validate()
function, which is why I placed the new check there as well. I suppose that we could try to move this whole functionality over to the form if it is not used by any other part of the module, but the current implementation works fine right now. - Also, are you able to resolve the two threads that I opened? Resolving your own threads seems to be disabled in the GitLab UI for this module.
- ๐ฉ๐ชGermany lrwebks Porta Westfalica
Well, the failing test was green locally, so I decided to try to run another pipeline, and: No more fails! Seems weird to me though, as I did not update the fork or anything similar in between pipelines, so this feels like a weird PHPUnit hiccupโฆ It could be related to the fact that the failed FunctionalJavascript test seems to use the
waitForElementVisible()
function a lot, which can fail randomly if the page loading takes too long.
Anyway, back to review! - ๐จ๐ญSwitzerland berdir Switzerland
Adding a leading slash also works, which makes it even unclear what's expected and which side-effects this might have!
The answer should be "no side effects", generated aliases will always have a leading /.
Instead of failing with an error, we could just ensure the / is always there and add it on save?
Also not sure this is a bug, this just makes things a bit more consistent in the pathauto UI.
- ๐ฉ๐ชGermany Anybody Porta Westfalica
Thanks for the feedback @berdir. :)
Also not sure this is a bug, this just makes things a bit more consistent in the pathauto UI.
Yes, I remember Drupal 8 made this switch in several cases in core, forcing to start with a leading slash, which was unclear in Drupal 7- And I think it's a good idea for consistency = usability. So I'd clearly vote to do the same in all Drupal 8+ modules, even if it's not a clear bug.
- ๐ฉ๐ชGermany Grevil
I agree with @berdir here. Instead of throwing a validation error, we should simply add a leading slash to the pathauto pattern on submit, if none exists, instead of throwing a validation error here!
- ๐บ๐ธUnited States dalemoore
I'm in favor of consistently including the leading slash, I just noticed that in this new site I am working on I've included it in some patterns and excluded it in others. As long as it silently adds it on save but continues to work for existing patterns without (or maybe updates existing ones on sav of the Patterns page, or in a module update hook) it sounds like a nice feature to improve consistency.