Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TaggingUtility::slug does not support UPPERCASE tags #205

Closed
visbits opened this issue Mar 9, 2022 · 3 comments
Closed

TaggingUtility::slug does not support UPPERCASE tags #205

visbits opened this issue Mar 9, 2022 · 3 comments

Comments

@visbits
Copy link

visbits commented Mar 9, 2022

First off, THANK YOU, this tagging module is very useful and has been extensively implemented in my projects.

Couple issues I've found and started working on a branch with fixes but got deep in the weeds and realized a few things that I'll just itimize.

  1. line 75 of TaggingUtility references
    'delimiter' => config('taggable.delimiter', '-'),
    should be
    'delimiter' => config('tagging.delimiter', '-'),

  2. Adding support for uppercase tags looks like it was started at line 77 but upon further investigation the relationship model of tagging_tagged and tagging_tags relies on the tag_slug match which could become easily broken if one is manipulated without the other.

  3. I changed lowercase to false but in my database the tagging_tagged->tag_slug remains uppercase but tagging_tags->slug becomes Pascal...

I will continue to work on this and hopefully provide a PR unless you immediately know how to support retaining tags as uppercase.

Thanks!!!

@rtconner
Copy link
Owner

rtconner commented Mar 9, 2022

This is the most interesting ticket opened in a while. Thanks. I won't be able to dig into details on this until probably Saturday.

@visbits
Copy link
Author

visbits commented Mar 29, 2022

@rtconner did you get a chance to poke at this? I got sidetracked by other things.

@rtconner
Copy link
Owner

I changed lowercase to false but in my database the tagging_tagged->tag_slug remains uppercase but tagging_tags->slug becomes Pascal...

I think this is not the correct way to do it.

You should php artisan vendor:publish --tag=config and then modify the 'normalizer' value in there. I believe this is the correct way to do it.

<?php

return [
	'normalizer' => 'strtoupper',
]

rtconner added a commit that referenced this issue Apr 25, 2022
@rtconner rtconner closed this as completed May 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants