Closed (outdated)
Project:
Unique field
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
19 Feb 2008 at 13:38 UTC
Updated:
18 Apr 2024 at 08:55 UTC
Jump to comment: Most recent
Comments
Comment #1
Matthew Davidson commentedFor that matter, I think Views should be used to determine uniqueness. The majority of this module is query-building code. Drupal already has a query builder: Views. This would not only remove the current limitation to CCK fields and mean you automatically support any fields that have Views integration, but would also open the module up to imposing uniqueness constraints on things other than nodes.
The way I think it might work would be to define a new Views display type ("Uniqueness", or something). When a node (or user, or taxonomy term...) form submission is being validated, any relevant "Uniqueness" views are executed, using values from the form submission in the view arguments. If any results are returned, the form doesn't validate.
I haven't worked much with the Views 2 API (don't think it's worth backporting to Views 1), but I think this approach is feasible, and would clean up most of the issues currently in the queue. Would also clean up your UI code, as you'd be mostly using the Views UI.
Would like to work on this myself, but won't have time for quite a while. :(
Comment #2
japanitrat commentedI am pretty much the same opinion. Although it IS a great module and it does its job most of the times, it's kinda messy inside. I just reviewed the code in order to make ajax-checks working, but I feel a bit lost in this huge hook_nodeapi definition. I mean, taxonomy and CKK are quite different things in terms of architecture and this should actually be reflected in the module's code, I suppose.
So if we want to get anything near Views, the architecture has to be rewritten completely with more focus on encapsulation. And this is not gonna happen, I believe ;)
Comment #3
Andrew Gorokhovets commented+1
Comment #4
astonvictor commentedI'm closing it because the issue was created a long time ago without any further steps.
if you still need it then raise a new one.
thanks