It would be possible to integrate with the Domain Access module?
For example, nodes that can not have duplicated titles in the same sub-domain, but can be included again in another.
1) Subdomain x: title "hello" (unique)
2) Subdomain y: title "hello" (unique)

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

rogeriodec’s picture

Well, I realized that I can avoid this by placing the field "author" in combination with other fields, since (in my case) the author of the node will always be a different user.
Yet the suggestion remains open.

GaëlG’s picture

Issue summary: View changes

I could make it on rc1 by altering a bit the module with this logic in unique_field_match_value():

  $efq->addTag('unique_field_match');
  if (isset($entity)) { //entity has to be passed as a new argument
    $efq->addMetadata('entity', $entity);
  }

This allows me to do that in my custom module:

/**
 * Implements hook_query_TAG_NAME_alter().
 */
function my_module_query_unique_field_match_alter(QueryAlterableInterface $query) {
  if (module_exists('domain_source')) {
    $entity = $query->getMetaData('entity');
    $base = $query->alterMetaData['base_table'];
    foreach($query->getTables() as $alias => $info) {
      if ($info['table'] == $base) {
        $base_alias = $info['alias'];
        break;
      }
    }
    if (isset($base_alias) && isset($entity->domain_source)) {
      $query->innerJoin('domain_source', 'ds', "%alias.nid = $base_alias.entity_id AND $base_alias.entity_type = 'node'");
      $query->condition('ds.domain_id', $entity->domain_source);
    }
  }
}
askibinski’s picture

Version: 6.x-1.4 » 7.x-1.x-dev
Assigned: rogeriodec » Unassigned
Status: Active » Needs review
FileSize
1.37 KB

Here is a new patch against 7.x.

Unlinke the code in previous comment, I don't rely on the domain_source module which is optional.

askibinski’s picture

Status: Needs review » Needs work

Making a better patch, last one had an empty module_exists and no settings options.

askibinski’s picture

Status: Needs work » Needs review
FileSize
3.22 KB

Here is an improved patch with added options per content type for scoping.

askibinski’s picture

Status: Needs review » Needs work

Hmmm... testing this some more, the join does not actually seem to be executed. Weird, should work.

AstonVictor’s picture

Status: Needs work » Closed (outdated)

I'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