Well, I have not been developing websites on Drupal, lately. Which has led to me to stop acting on the project. This would probably be best maintained by someone who is familiar with the new Core Fields in Drupal 7. Just let me know who wants to maintain the project, and how I can add them as a maintainer.
Just for your information, an alternative would be to use the Rules Project, as it ships with forms manipulation now (which includes validation)
A strating point is the README.txt
Rules might seem not easy to grasp at first use but once you get it, you can do amazing things !
just take a look to rules v1.1 (as well as Dec15 dev), but the form "validation" can only do exact matches. That is, admin can only provide a list of valid values, but not a reg. exp., which make it useless
Oh you are right...
But may be one could implement a rules condition module that offers regexp (or php) validation :
<?php
/**
* Implementation of hook_rules_condition_info().
* @ingroup rules
*/
function yourmodule_rules_condition_info() {
return array(
'yourmodule_condition_match_regexp' => array(
'label' => t('Element matches regexp'),
'arguments' => array(
'form' => array('type' => 'form', 'label' => t('Form')),
'form_state' => array('type' => 'form_state', 'label' => t('Form state')),
'element' => array(
'type' => 'string',
'label' => t('Form element ID'),
'description' => t('ID of the form element to be targeted.') ,
'pattern' => array(
'type' => 'string',
'label' => t('Regular expression to match against'),
'description' => t('Some description')
),
'module' => 'My Module',
),
);
}
/**
* Condition implementation: Match element value against regexp pattern.
* This is just a quick and dirty example, you should add multiple values handling
*/
function yourmodule_condition_match_regexp($form, $form_state, $element, $pattern) {
$form_element = _rules_forms_get_element($form, $element);
if (isset($form_element['#value'])) {
// Multiple values come in as array, the following should work for a single value
$matches = preg_match($pattern, form_element['#value']);
return $matches > 0;
}
}
?>
Of course this is just an example. The function yourmodule_condition_match_regexp needs to take care of multiple values....
My suggestion for rules is just to let people know that there exists alternative approches to validation. Of course validation API is a very good and quick solution. I just suggested rules for people that are afraid of using validation API whose maintainers might not have enough time to devote (the reason this issue exists).
Rules on the other hand has a lot of modules that depend on it or integrate with it, which somehow guaranties its continuous support by the community
As for the reason why rules does not have regexp feature, well rules is a very extensible framework and they just can't implement every "condition+action" feature you can think of, there are "infinite" conditions/actions you can implement using rules. For that they have made a very good api to let developers implement their own.
Since i use rules extensively. I will surely code the regexp condition module for rules in the near future, i just don't have much time for it now...
I'll let you know when i do it, if you ever still need it by that time !
I'm planning to use a kind of this module for my current website. After a quick review, the basic features work well. Thus I'd like to take the ownership.
I'm willing to update this project to work with Drupal 7. Has the original maintainer completely abandoned it? He says he stopped building websites with Drupal but I see he asked a question last week. Do I need to contact him to verify or what?
@qler: The answer from the previous maintainer clearly states that he is not developing Drupal-powered sites anymore.
The module is actually marked as abandoned; the previous maintainer cannot decide who can take over the project.
Well I just noticed now that the 2 developers above me were willing to maintain it. Is anyone maintaining it now? I'd like to use this module and have it work with the new Field API in 7, but if someone else is willing to do the work, of course I'd be very happy and thankful to them :D What's the status of this module then? Its issue queue was never answered. It is being killed or what?
I see you guys were interested in this module. Are you privately updating it for your projects? If you are, do you have any code to share? I'd be happy to help and share my code too and the 3 of us could join efforts and share code until it gets sorted out here. Please contact me. I'm sure this would benefit everyone. I see this module replacing a lot of custom code once it's updated.
@qler i think you better direct message them.
Ask for take over first, if you really interested in developing this. You need 30 days before you can have commit rights after announcing to take over. take a look to http://drupal.org/node/59
Comments
Comment #1
lourenzo commentedThere was near a year since the last dev version, and the issues are no longer been replied by the maintainer
Comment #2
dave reidChanging title as per http://drupal.org/node/251466
Comment #3
TapocoL commentedWell, I have not been developing websites on Drupal, lately. Which has led to me to stop acting on the project. This would probably be best maintained by someone who is familiar with the new Core Fields in Drupal 7. Just let me know who wants to maintain the project, and how I can add them as a maintainer.
Comment #4
LEternity commentedsubscribe
Comment #5
redben commentedJust for your information, an alternative would be to use the Rules Project, as it ships with forms manipulation now (which includes validation)
A strating point is the README.txt
Rules might seem not easy to grasp at first use but once you get it, you can do amazing things !
Comment #6
joetsuihk commentedjust take a look to rules v1.1 (as well as Dec15 dev), but the form "validation" can only do exact matches. That is, admin can only provide a list of valid values, but not a reg. exp., which make it useless
that is rules issue, anyway
Comment #7
redben commentedOh you are right...
But may be one could implement a rules condition module that offers regexp (or php) validation :
Of course this is just an example. The function yourmodule_condition_match_regexp needs to take care of multiple values....
for more info http://drupal.org/node/298533
Another good thing is that rules are exportable and (i think) integrate with features
Comment #8
joetsuihk commentedthx!
but before i submit a feature request to rules module, is there any reason that rules do not provide a generic reg exp to do validation?
it seems validation api module is still the better solution to validate with the use of reg exp?
Comment #9
redben commentedMy suggestion for rules is just to let people know that there exists alternative approches to validation. Of course validation API is a very good and quick solution. I just suggested rules for people that are afraid of using validation API whose maintainers might not have enough time to devote (the reason this issue exists).
Rules on the other hand has a lot of modules that depend on it or integrate with it, which somehow guaranties its continuous support by the community
As for the reason why rules does not have regexp feature, well rules is a very extensible framework and they just can't implement every "condition+action" feature you can think of, there are "infinite" conditions/actions you can implement using rules. For that they have made a very good api to let developers implement their own.
Since i use rules extensively. I will surely code the regexp condition module for rules in the near future, i just don't have much time for it now...
I'll let you know when i do it, if you ever still need it by that time !
Comment #10
aren cambre commentedFollowing abandoned module process. Module author confirms abandoned in #3.
Comment #11
avpadernoI have marked the project as abandoned as per comment #3.
Comment #12
avpadernoComment #14
crisbarros commentedI'm intending to use this module on a production environment. I'd like to take the module ownership, as I'll have to fix the bugs anyway.
Comment #15
avpaderno@crisbarros: You cannot take over a project without to have a CVS account.
Comment #16
jcisio commentedHello,
I'm planning to use a kind of this module for my current website. After a quick review, the basic features work well. Thus I'd like to take the ownership.
Comment #17
qler commentedI'm willing to update this project to work with Drupal 7. Has the original maintainer completely abandoned it? He says he stopped building websites with Drupal but I see he asked a question last week. Do I need to contact him to verify or what?
Comment #18
avpaderno@qler: The answer from the previous maintainer clearly states that he is not developing Drupal-powered sites anymore.
The module is actually marked as abandoned; the previous maintainer cannot decide who can take over the project.
Comment #19
qler commentedWell I just noticed now that the 2 developers above me were willing to maintain it. Is anyone maintaining it now? I'd like to use this module and have it work with the new Field API in 7, but if someone else is willing to do the work, of course I'd be very happy and thankful to them :D What's the status of this module then? Its issue queue was never answered. It is being killed or what?
Comment #20
avpadernoThe project is abandoned; abandoned projects are not killed.
Comment #21
qler commented@crisbarros and @jcisio,
I see you guys were interested in this module. Are you privately updating it for your projects? If you are, do you have any code to share? I'd be happy to help and share my code too and the 3 of us could join efforts and share code until it gets sorted out here. Please contact me. I'm sure this would benefit everyone. I see this module replacing a lot of custom code once it's updated.
Comment #22
joetsuihk commented@qler i think you better direct message them.
Ask for take over first, if you really interested in developing this. You need 30 days before you can have commit rights after announcing to take over. take a look to http://drupal.org/node/59
Comment #23
avpadernoThere have not been any feedback about taking over this project; if you are still interested, please open a different issue report.