Download & Extend

Allow the provider to specifiy the regex for the modifier

Project:Persistent URL
Version:6.x-1.0-beta4
Component:Code
Category:feature request
Priority:minor
Assigned:rbrandon
Status:needs work

Issue Summary

Allow the provider to specify the regex for the modifier, this allows more flexibility. For example, you would want to allow periods (.) to be present in the modifier for domains but not for the modifier for paths or subdomains.

PATCH ATTACHED, you could also use a function for further flexibility instead of the regex string...

It would also be nice if the options in _purl_options were not hardcoded there, or allow people to add more via a hook. It will be helpfull for people that would like to create custom providers.

AttachmentSize
dynamic_modifier_validate.patch1.47 KB

Comments

#1

I need to think a bit more about this patch, but I can tell you that I'm planning to move this module to use plugins.inc from ctools to allow for developers to provide custom url handling via purl.

#2

Status:needs review» needs work

The ctools refactoring has been committed to the DRUPAL-6--1 branch. As a result _purl_options() is no longer a hardcoded list, and other modules can provide new processors.

From here it would seem to make sense to moving this validation code into the processor classes, but I'm not sure we want to do that. yhahn and have had a couple conversations about moving the mapping behavior that a few of the processors (path, domain, subdomain) use either out of purl, or refactoring it in some way that better respects how some processors will use it, some won't and some optionally could.

Input here is very welcomed.

#3

Category:bug report» feature request

Updating category.

#4

The ctools re-factoring looks good, I like the progress!

I think it makes sense to move the validation call into the processor class. It is more flexible than providing the regex which was a bare minimum for providing the flexibility. Why are you hesitant in including that in at least the base processor class?

Thanks for your work.

--Richard

#5

I updated to Beta12 and love the changes.

Attached is the new patch for beta12.

I would love to move away from the regex code and allow for each processor to provide it's own validate function. If you want to go in that direction let me know and I will change and submit a small patch.

Cheers,
Richard Brandon

AttachmentSize
dynamic_modifier.Beta12.patch 1.54 KB