netgen / TagsBundle

Netgen Tags Bundle is an eZ Platform bundle for taxonomy management and easier classification of content, providing more functionality for tagging content than ezkeyword field type included in eZ Platform kernel.
https://netgen.io
GNU General Public License v2.0
48 stars 43 forks source link

Urlencode and urldecode #148

Closed AUDUL closed 2 years ago

AUDUL commented 2 years ago

Tag url is encoded with "urlencode" function but decoded with "rawurldecode"

So I get a 404 error when accessing the tag

Is it possible to choose a single RFC to encode and decode the url

emodric commented 2 years ago

Hi @AUDUL !

Can I bother you to give me an example of a tag that does not work?

AUDUL commented 2 years ago

If you replace the + by %20 the url work

https://www.code-rhapsodie.fr/tags/Technos/Dataflow/eZ+Dataflow

patrickallaert commented 2 years ago

I confirm I am facing the same issue. With tags containing a space, the URL generated by template: vendor/netgen/tagsbundle/bundle/Resources/views/eztags_content_field.html.twig for tag "Sport et loisirs" will be: https://example.com/tags/view/Sport+et+loisirs Navigating to that page will result in an error: Could not find 'tag' with identifier 'Sport+et+loisirs' However changing the URL to https://example.com/tags/view/Sport%20et%20loisirs works.

patrickallaert commented 2 years ago

I can confirm that patch https://gist.github.com/patrickallaert/eb497baef9e3cca4806f8294da6dadaa does solve the problem here.

patrickallaert commented 2 years ago

ping @emodric

emodric commented 2 years ago

Hi @patrickallaert

I'll try to take a look at this next week.

Thanks for the proposed solution 👍

emodric commented 2 years ago

Fixed in 4.0.18 and 5.0.1.

Thanks @patrickallaert for the fix and @AUDUL for reporting the issue!