I am trying to use this with a content type in which I want the author and a node reference field to be unique (in combination) for all content of that type. In other words, I need to force each user to create only one node for each possible reference node.

Functionality is correct when creating new nodes. The error is occurring when editing those nodes after they've been saved. When trying to save the node for the second time, Unique Field gives the error that fields are supposed to be a unique combination, then references ALL other content of that type for which I'm author as matches.

I am using the Node Reference from URL widget to set the value of the node reference field. However, I disabled that and fell back to the standard autocomplete widget and still had the same problem.

Comments

arithmetric’s picture

Status: Active » Postponed (maintainer needs more info)

I can't reproduce this issue. With the latest release, I'm able to configure a content type to require unique values for the combination of the author and a node reference field.

Could you test again with the latest code? If it's still not working, could you post screenshots of the Unique Field configuration for the content type and of the error message you receive when submitting unique content?

derhasi’s picture

Priority: Normal » Major
Status: Postponed (maintainer needs more info) » Needs review
StatusFileSize
new1.65 KB

This is a major bug, when the module is used on a multilingual page (or a page where locale is activated). So it can be that the node language is for example 'de' (for german), but the fields are generally not stored language aware (so have the language value 'und').

This can easily be fixed by using the field api functions for that: field_get_items().

The attached patch solves this that way ;)

derhasi’s picture

Version: 7.x-1.0-beta1 » 7.x-1.x-dev

I applied the patch to the current dev.

arithmetric’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

justmagicmaria’s picture

Having the same issue but there is no -dev release available for this project.

derhasi’s picture

JustMagicMaria, rc1 should contain the fix allready.

justmagicmaria’s picture

Hmm... sorry for missing that this was closed before rc1 was created, but I am still experiencing this issue with rc1.