plone / plone.outputfilters

Provides a framework for registering filters that get applied to text as it is rendered.
6 stars 15 forks source link

Check if there is actually a UUID #43

Closed gforcada closed 1 year ago

gforcada commented 3 years ago

On the ResolveUIDView browser view it gets the uuid from the URL (in publishTraverse) and on the __call__ method it tries to resolve it.

There is a small problem there though, if there is no UUID provided, i.e. rather than http://localhost:8080/Plone/some-path/@@resolveuid/RANDOM-UUID it is just http://localhost:8080/Plone/some-path/@@resolveuid then it breaks with:

Traceback (innermost last):
  Module ZServer.ZPublisher.Publish, line 144, in publish
  Module ZPublisher.mapply, line 85, in mapply
  Module ZServer.ZPublisher.Publish, line 44, in call_object
  Module plone.outputfilters.browser.resolveuid, line 65, in __call__
AttributeError: 'ResolveUIDView' object has no attribute 'uuid'

The question would be: how should it be handled? send it to the site root? to the parent object? :thinking:

davisagli commented 1 year ago

~I think this should return a 400 Bad Request response.~ Changed my mind, 404 sounds good.