The Problem is back (see also: http://drupal.org/node/197757)

After installing I have the following entries in my node access table, showing all nodes on domain 0 and 2:

nid     gid     realm aufsteigend     grant_view     grant_update     grant_delete
0       2       domain_id             1              0                0
0       0       domain_id             1              0                0

Removing them solves the problem.

what i did:

  • Drupal 5.5
  • Domain Access rc1
  • clean node_access table with single default entry
  1. allplied the url_alter patch
  2. added settings.php entry acording to Domain Configuration README.txt
  3. set define('DOMAIN_INSTALL_RULE', FALSE); in domain.module
  4. uploaded module

installed/enabled one by one:

  1. Domain Access
  2. Domain Configuration
  3. Domain Content
  4. Domain Navigation
  5. Domain Views

changed settings for default domain:

  • Only show on selected sites
  • Show user their publishing options
    Rewrite all URLs to point to a single source

then

  • i added 2 subdomains to the list
  • unchecked all node types under Node settings

then used "affiliated content" listing for default domain to bulk change domain access settings. sub 1 works fine.

Comments

agentrickard’s picture

Component: Code » - Domain Content

This is a great bug report.

I think the problem is (obviously) here:

then used "affiliated content" listing for default domain to bulk change domain access settings. sub 1 works fine.

What, exactly, did you do here? My suspicion is that an nid of 0 is being passed here somewhere.

agentrickard’s picture

Found it.

agentrickard’s picture

Status: Active » Needs review

The $form_values['nodes'] array wasn't coming through as I expected it to when processing the form in Domain Content.

Patch is to wrap this statement in an IF.

Line 371 of domain_content.module:

    foreach ($form_values['nodes'] as $nid) {
       if ($nid > 0) { // this is the new IF statement
        // Delete anything not selected.
        db_query("DELETE FROM {node_access} WHERE nid = %d AND realm IN ('domain_id', 'domain_site', 'domain_editor')", $nid);
        if ($domain_site) {
          db_query("INSERT INTO {node_access} VALUES (%d, 0, 'domain_site', 1, 0, 0)", $nid);
        }
        if (!empty($domains)) {
          foreach ($domains as $id) {
            db_query("INSERT INTO {node_access} VALUES (%d, %d, 'domain_id', 1, 0, 0)", $nid, $id);
          }
          if ($editor) {
            db_query("INSERT INTO {node_access} VALUES (%d, %d, 'domain_editor', 0, 1, 1)", $nid, $id);
          }
        }
      }
    }  

Proper patch possible later, if you can test this fix, that would be great.

derjochenmeyer’s picture

I was suspecting the batch editing before :) (see: http://drupal.org/node/197642#comment-649210) maybe that issue is however related?

Thanks for the fix! I'll test it :)

agentrickard’s picture

Yes. I believe these are the same error. Before I removed the node_operation for "change affiliate publishing" to only function on the Domain Content page, this same error would be repeated, I believe, if you used Drupal's normal batch editing mode.

derjochenmeyer’s picture

I did a lot of batch editing and had no problems with unwanted node_access entries. Fix works. (however, is this related? http://drupal.org/node/202830)

agentrickard’s picture

Status: Needs review » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)

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

kenorb’s picture