I'm having trouble with anonymous users creating nodes. The nodes they create are not being published to any domain. So the only one who can see these nodes are the administrator.
As I understand it, anonymous users need two things to be able to publish to a domain (and therfore publish content)
1. The Domain Access permissions "publish from assigned domain" and "publish from default domain"
2. In Domain Access settings under "Default Settings" anonymous must be configured to have a default domain
I've done this. (see attachments)
When the anonymous user creates the "registration" the node is inserted and is visible to the Administrator in views, but not visible to any other user - UNLESS - I rebuild node permissions. So I *think* my configuration is correct, (though I can't be sure)
** What can I look into, why is this happening? Is this a bug? **
I've tried using devel to look at the problem, but can't figure out how to use anything except the SQL queries to help myself out. (and that didn't yield anything useful either :( )
I'm using Drupal 6.15. I have the following modules installed:
Domain Access
Domain Configuration
Domain Content
Domain Theme
Domain Views
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | Permissions.png | 13.61 KB | cpall |
| #1 | DomainAccessSettings.png | 31.85 KB | cpall |
Comments
Comment #1
cpall commentedComment #2
agentrickardYour settings are correct.
It looks like there is a logic issue in domain_uppdate_6002(). This causes user 0 to be assigned to the root domain in the {domain_editor} table. Which means the user is always assigned to the primary domain, and the 'published from assigned domain' setting defaults there, overruling what you set.
This is not repeated in the domain_enable() function, which only inserts users > 0.
In any event, if you can, delete the row in {domain_user} where uid ==0;
After that, the settings should work fine. Note, however, that 'publish from assigned domain' will normally trump 'publish to default domain', so you can't give both permissions to the same role.
This is technically a bug, albeit one in the update function, and I am hesitant to commit a fix for it.
Comment #3
cpall commentedWhen I said "registration" I just meant creating a content node. (the content type happens to be a "registration" record)
Comment #4
agentrickardYes. I know. Cross-post.
Comment #5
agentrickardYou should also use the module's built in debugging features to check which domains the node is getting assigned to. If you are using a normal node form, you shouldn't have any problems. If you are using custom code, you might have an issue.
Normally, node access permissions are rebuilt when a node is saved.
Comment #6
cpall commentedThank you so much --
I'm trying out some things based on your comments above, I'll post a response as soon as I know what worked and why.
Comment #7
agentrickardPlease don't change the issue status. I'd still like some other opinions about whether this is a bug that needs fixing.
Comment #8
cpall commentedI'm baffled, I've been essentially looking at this for two weeks (mostly because I'm new at Drupal overall, otherwise I would have written earlier, I'm still not certain it's not something stupid I'm doing) So, sorry if I'm coming from left-field here most of the time.
I don't know why, but it works when I throw in:
node_access_acquire_grants($node);
into the insert of the hook_nodeapi call. It seems like a pretty ugly hack. I'm again not sure what else to look at.
I didn't have the record as you described in domain_editor table, so the delete didn't do anything. In fact, I had no domain_editor for the user 0.
Comment #9
agentrickardThat is a totally wrong hack. It's not even the correct function to invoke. Some other module that you are using might be interfering with the API. Node grants are gathered and saved at the end of node_save().
I cannot replicate this error.
Three questions:
1) Which domain modules are you using?
2) What other modules? Especially node access modules.
3) What is getting saved into the {domain_access} and {node_access} tables for nodes created by anonymous users?
Comment #10
cpall commentedIt's the drupal_goto at the end of the nodeapi insert handling. I wanted to redirect to a different page but keep a pointer to the node created (so the goto looks like (drupal_goto('somepage?nid=[nid]')).
I didn't realize that drupal_goto effectively terminated the thread of execution, even though it says it "ends" the request. (also, if this is the case that it's ending the execution, why did I still end up with a node that was saved and a valid node ID to redirect to?)
Comment #11
agentrickardHas to do with execution order of the API. You can't really redirect nodes, actually, because of a hardcoded redirect in node.module.
So this was self-inflicted by custom code?
Comment #12
cpall commentedYep. Blunt force trauma apparently. Very sorry - still not sure if I have a good route to do what I want to do, but that's for another forum :)
Comment #13
agentrickardI had to do something similar in the function domain_node_save_redirect(). The problem is that you can't use the normal $form['#redirect'] property when dealing with nodes.
But, yeah, you can't issue a goto during form submission.
Closing.