- Merge request !65Issue #3311415: Allow to trim special characters from the end β (Open) created by Grevil
- πΊπΈUnited States DamienMcKenna NH, USA
I fixed the update script as it had been hidden inside a different update script; also, it should have been named metatag_update_8110().
The last submitted patch, 15: metatag-n3311415-15.patch, failed testing. View results β
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.- Status changed to Needs work
over 1 year ago 6:38am 13 April 2023 - last update
over 1 year ago 372 pass - Status changed to Needs review
over 1 year ago 2:58pm 17 April 2023 - π©πͺGermany Grevil
Yikes, found a pretty embarrassing bug, leading to the trimByMethod() not working properly, all fixed now, tests are green. Please review once again!
- Open on Drupal.org βCore: 9.5.5 + Environment: PHP 7.3 & MySQL 5.7last update
over 1 year ago Waiting for branch to pass - Status changed to RTBC
over 1 year ago 2:36pm 18 April 2023 - π©πͺGermany Anybody Porta Westfalica
LGTM!
Just two things:
1. I'm just not totally sure if this partstr_replace("\\", "\\\\", $trimEndChars)
is the best solution, but also have no better idea yet.
2. Did you test (manually), that the update hook with that number runs? I agree with your documentation (while @DamienMcKenna may of course decide to keep the 8 in front). But I also remember there were some flaws with these update hook numbers, so we should be 100% sure this works at least :)
Settings this RTBC for now, but would be nice if @DamienMcKenna could have a look and @Grevil could give some final feedback on the points.
- Status changed to Needs review
over 1 year ago 7:04pm 25 April 2023 - last update
over 1 year ago 372 pass - πΊπΈUnited States DamienMcKenna NH, USA
I'm sticking with the 8xxx series of the update scripts following the branch number convention, not the core number convention, as it keeps them more consistent. I also spotted that the update script wasn't running $config->save() after setting the value, and improved the settings form's wording.
- πΊπΈUnited States DamienMcKenna NH, USA
I wonder if we should expand the default list of characters to remove, #13 provided a reasonable list of additional ones that would be worthwhile to add as a default.
- π©πͺGermany Anybody Porta Westfalica
I'm sticking with the 8xxx series of the update scripts following the branch number convention, not the core number convention, as it keeps them more consistent.
Fine! :)
I also spotted that the update script wasn't running $config->save() after setting the value,
Thank you for spotting this. ouch!! Painful mistake!
I wonder if we should expand the default list of characters to remove, #13 provided a reasonable list of additional ones that would be worthwhile to add as a default.
As I suggested these, someone else should please decide. I personally like the idea.
FYI: "Path" module solves this differently, using selects. And it has an evolved list:
/admin/config/search/path/settingsShould we decide based on this perhaps? What about the UI/UX? I don't think we need selects or checkboxes in our case and the input is more flexible?
Any other defaults to add?
I guess it's fine if you decide @Damien!
- Status changed to Needs work
10 months ago 3:20pm 18 March 2024 - Open on Drupal.org βCore: 10.2.1 + Environment: PHP 8.1 & MySQL 8last update
10 months ago Not currently mergeable. - Open on Drupal.org βCore: 9.5.5 + Environment: PHP 7.3 & MySQL 5.7last update
10 months ago Not currently mergeable. - π©πͺGermany Grevil
Grevil β changed the visibility of the branch 2.0.x to hidden.
- π©πͺGermany Grevil
Grevil β changed the visibility of the branch 3311415-allow-to-trim to hidden.
- Merge request !103Issue #3311415 by Grevil, DamienMcKenna, Anybody: Allow to trim special characters from the end β (Merged) created by Grevil
- last update
10 months ago 128 pass - π©πͺGermany Grevil
I manually added 2.0.x to this issue fork, added an appropriate 3311415-2.0.x issue branch, created a new MR targeting 2.0.x, applied all 8.x targeted changes to the new issue branch and additionally applied the changes from Damiens interdiff in #21 β¨ Allow to trim special characters from the end Needs work .
I'll manually test the functionality in a couple of days and provide code additions concerning #22. Until then, I keep this on "needs Work".
- last update
10 months ago 128 pass - last update
10 months ago 128 pass - last update
10 months ago 128 pass - Status changed to Needs review
10 months ago 9:11am 19 March 2024 - Status changed to Needs work
10 months ago 10:01am 19 March 2024 - π©πͺGermany Anybody Porta Westfalica
Great work @Grevil once again! Code LGTM and all feedback seems to have been addressed.
Still, I have two things to discuss regardin the wording and UX:
1. We're no native speakers, so it would be great if @DamienMcKenna could review and improve all the texts.2. I'm not totally happy with the UX of the added
<select>
value.
The select value "Only trim specified characters at the end of the Meta Tag" tells me something different then the description of the field:
"The trimming is applied after the tag is trimming for length, and after the trimming option was executed"Furthermore I think you'd like to combine the existing options with the new optional character trimming, not have it as alternative? Currently it seems xor from the UI and that seems strange to me and misses the real world use case, where you'd always like to trim these characters from the end, if configured. Also if they appear at the end after length trimming, which is quite typical.
Example:
My quite long page title | My wonderful sitename
might be truncated toMy quite long page title |
and in such cases you don't want the title to end with|
! That's one of the most important use-cases.So if I don't get things wrong, we either
- need an additional checkbox to enable the character trimming instead of the select value
- or need to leave the default empty and provide the suggested example values so it's used if filled.
- last update
10 months ago 128 pass - Status changed to Needs review
10 months ago 10:16am 19 March 2024 - π©πͺGermany Grevil
Definitely agree, that the fourth option is confusing (and not needed)!
We can simply leave the maximum length option empty and achieve the same output! I wonder why, though this was a good idea in the original patch. :D
Adjusted accordingly. Note that the texts were already coming from Damien originally.
- Status changed to RTBC
10 months ago 10:18am 19 March 2024 - π©πͺGermany Anybody Porta Westfalica
Great! RTBC from my side, let's hear what @DamienMcKenna says and finish this helpful feature :)
- last update
7 months ago 120 pass - π©πͺGermany Anybody Porta Westfalica
Static patch attached, because I'm afraid 2.1.0 will need some more months. (Still hope it might land earlier :P ;))
- Status changed to Needs work
7 months ago 12:58pm 19 June 2024 - π©πͺGermany Anybody Porta Westfalica
@Grevil: Just ran into the following issue in production:
TypeError: Drupal\metatag\MetatagTrimmer::trimEndChars(): Argument #2 ($trimEndChars) must be of type string, null given, called in /web/modules/contrib/metatag/src/MetatagTrimmer.php on line 129 in Drupal\metatag\MetatagTrimmer->trimEndChars() (line 81 of modules/contrib/metatag/src/MetatagTrimmer.php).
which is called from
metatag/src/Plugin/metatag/Tag/MetaNameBase.php on line 659
After setting a value in the characters to trim field, it works fine!
So I guess we should add valuable defaults or have to change the string check! - last update
7 months ago 120 pass - last update
7 months ago 120 pass - Status changed to Needs review
7 months ago 9:45am 20 June 2024 - last update
7 months ago Patch Failed to Apply - π©πͺGermany Grevil
Whoops, the new install hook was inside the brackets of the older install hook...
Fixed it again. Static patch provided.
- Status changed to RTBC
7 months ago 9:48am 20 June 2024 - π©πͺGermany Anybody Porta Westfalica
Perfect, thank you @Grevil! Working as expected now. Back to RTBC and ready for the go :)
- Status changed to Needs work
3 months ago 8:21pm 20 September 2024 - πΊπΈUnited States DamienMcKenna NH, USA
The MR needs to be updated to work off the 2.1.x branch.
- π©πͺGermany Anybody Porta Westfalica
@damienmckenna maybe this could be merged into 2.1.x-dev already? (I'm very much looking forward to the 2.1.0 release as this is a major SEO improvement and simplification for many of our projects :))
-
damienmckenna β
committed 4fa4f15c on 2.1.x authored by
grevil β
Issue #3311415 by grevil, damienmckenna, anybody: Allow to trim special...
-
damienmckenna β
committed 4fa4f15c on 2.1.x authored by
grevil β
- π©πͺGermany Anybody Porta Westfalica
Thank you soooo much @damienmckenna!! This is great news for us!
Automatically closed - issue fixed for 2 weeks with no activity.