When I'm trying to create any node as user who has his own domain user.mysite.com, I have notice "The source affiliate must be selected as a publishing option". What does it mean?
Thank you.

CommentFileSizeAuthor
#29 ds4.patch2.62 KBagentrickard
#18 ds3.patch1.18 KBagentrickard
#8 ds2.patch1005 bytesagentrickard
#6 ds.patch1016 bytesagentrickard

Comments

agentrickard’s picture

It means that there is some kind of logic bug in the Domain Source module that, at the moment, might mean it is not compatible with the Domain User module.

When the user tries to create the node, are they doing so from their personal domain?

agentrickard’s picture

Title: Can't create a node for user » Domain Source form validation error
agentrickard’s picture

Component: Miscellaneous » - Domain Source
Assigned: NeuZeitgeist » agentrickard
Category: support » bug

This is a form validation error. There is obviously a bug in Domain Source.

I believe that, in these cases, Domain Source assumes that a user with limited permissions is creating the node from a subdomain where he or she is an editor.

If that is not the case, the error makes sense.

My advice is to disable Domain Source for the time being. I will try to investigate further tonight.

[Note: only assign issues to yourself if you are working on a patch.]

agentrickard’s picture

OK. Trying to reproduce and test. Here's the setup:

Active modules

Domain Access
Domain Configuration
Domain Source
Domain User

Domains

example.com [root]
one.example.com
two.example.com
three.example.com [user-generated]

Settings

New content settings: *
Show on all affiliate sites 

Content editing forms: *
Pass the default form values as hidden fields 

Domain-based editing controls:
Do not use access control for editors 

User login behavior:
Do not go to personal domain on login

Roles and permissions

user 'three' has the permissions:
  -- view domain publishing	
  -- create personal domain

User three is assigned to the domain 'three.example.com'

Note: creation of the user domain, and assignment of the user to that domain worked properly.

Now testing node creation and editing. Report to follow.

agentrickard’s picture

Trying to create a blog post from three.example.com, I get the error "The source affiliate must be selected as a publishing option."

So that verifies the error. I was, however, able to create a blog post from example.com, but not from one.example.com.

agentrickard’s picture

Status: Active » Needs review
StatusFileSize
new1016 bytes

There is a logic error in how one of the arrays is being handled.

Please test the patch.

To apply the patch, place it inside domain > domain_source

boast’s picture

i get this when i run the patch in domain_source
#####################################
Patching file domain_source.module using Plan A...
Hunk #1 failed at 100.
1 out of 1 hunks failed--saving rejects to domain_source.module.rej
done
###################################
i tried a couple of posts and i still receive the same error

agentrickard’s picture

StatusFileSize
new1005 bytes

That means the patch did not apply, so of course the error is not fixed.

Odd. Try this one.

boast’s picture

I got exactly the same again

agentrickard’s picture

Then that's something you're doing wrong.

patch -p0 < ds2.patch 

Applies fine.

It's only a one-line patch. Apply it manually using copy-paste.

NeuZeitgeist’s picture

Yes, I disabled Domain Source module.after that I could create a node from user's domain (http://user.mysite.com)

agentrickard’s picture

Right. Now test the patch, which should fix the issue entirely.

skirr@drupal.ru’s picture

Didn't use Domain User, but had the same problem.
User assigned to example.com with "view domain publishing" couldn't create or preview a node at example.com
Because of the "The source affiliate must be selected as a publishing option".

Patch ds2.patch helped. thx.

Have same trouble with editing this node. And editing new nodes on example.com
But have no problems when creating and editing nodes at test1.example.com or test2.example.com

agentrickard’s picture

I do not understand. The patch fixed one problem but you still have a separate issue?

skirr@drupal.ru’s picture

Yes. The patch fixed a problem with creating a node. The User now can create a node.
But have the same problem with "edit" a node.

When User with "view domain publishing" access trying to edit (to submit a new version) his node, he gets
"The source affiliate must be selected as a publishing option"
This problem appears only on main domain "example.com"
On one.example.com and two.example.com everything works fine, yet.

User assigned to example.com and have rights to view domain publishing.

Dont really know is it a separate issue or a part of the same one.

agentrickard’s picture

I think it is part of the same error and means that the patch is not complete.

Thanks for the full report.

agentrickard’s picture

OK, I can confirm this second error -- it happens for users who have the 'view domain publishing' permission but _not_ the 'edit domain nodes' permission.

Testing a fix.

agentrickard’s picture

StatusFileSize
new1.18 KB

The attached should account for this situation. We have an ongoing issue where 0 (zero) is not an acceptable value to be passed by a checkbox group, so we always have to cast zero to -1 before running validation checks.

skirr@drupal.ru’s picture

thanks. Third patch fixed the issue.

2 all
dont forget to unpatch the old versions. Made that mistake first :)

agentrickard’s picture

Yes. If you have the old patch, do:

patch -p0 -R < ds2.patch
patch -p0 < ds3.patch

Or ds.patch instead of ds2.patch if you tested the first version.

boast’s picture

When i applied the ds3 patch i find that any node published is access denied to anonymous users. You can view the node as a user, i have double checked the roles and the permissions are correct for "view domain publishing" and "access content" for nodes.

Publishing with the "Send to all affiliates" option on allows the nodes to be viewed to anonymous users, but obviously the nodes are published on multiple domains and i only want to publish to 1 domain at a time.

Is this still a bug in the patch?

I also have an issue with themes, any edit on the themes for any domain, always changes the theme for every domain.

skirr@drupal.ru’s picture

Can't tell the same about my site. Tried to test the issue above:

Anonymous user has only "access content" and no domain rights.
Authenticated user has "access content", "create page content", "create story content", "edit own page content", "edit own story content" and "view domain publishing".
Pro-user has all node rights accept "administer nodes" (to have a right look at content on different sites) and all 5 rights of Domain Access.

Pro-user created a node affilated to all sites.
Authenticated user created nodes on different sites, but affilated to one of those sites. (created a node at example.com and created a node at one.example.com)

Anonymous user could see all content right at any site.
Authenticated user could see all content right at any site.
Pro-user could see all content right at any site.

I dont use Domain Strict, but sounds like the issue is about it.

boast’s picture

Yep switching off domain strict, solved the issue for me..many thanks for that;)

agentrickard’s picture

Domain Strict keeps tripping people up. It is clearly documented.

scedwar’s picture

The third patch has fixed my problem, probably the 0 value form validation problem.

Details of my problem: user was admin (haven't even tried others). Edit or submit new node only to the main domain (0) and no other returns:
"The source affiliate must be selected as a publishing option"
This problem appears only on main domain "example.com"
On one.example.com and two.example.com everything worked fine.
Domain strict and user NOT installed. All others installed including menu.

agentrickard’s picture

I think this is RTBC. Any other testers?

Triskelion’s picture

I have an issue with a subdomain created before I knew enough to change the DOMAIN_INSTALL_RULE.

I have hundreds on nodes to change. The ds3 patch solved the problem for single node edits, but when I try to do a bulk change using the 'Content for all affiliate sites' form, it rears its ugly head again. I hope is is a simple fix.

I tried doing a bulk change to assign everything to the subdomain. It worked. Then I tried to change it back to the mastrer domain. It failed. The problem seems to happen when we are trying to place content into domain 0 exclusively.

I await your response while I edit the nodes one at a time :-)

agentrickard’s picture

Ah. I had not tested that condition. This is what bug reports and testing are for.

agentrickard’s picture

StatusFileSize
new2.62 KB

Try this patch. You will need to revert any earlier patch versions first.

Triskelion’s picture

Worked like a charm. I went back and tested the single node edit and it continues to work.

Rather than try to revert the old patch (never liked to do that) I pulled a new copy of domain_source.module out of the tar ball. If you have another active patching situation, it might be wise to extoll the virtues of the -b option with serialized backups until the issue is resolved.

Thank you. Thank you. Your prompt attention to this means I can go home and have supper.

agentrickard’s picture

If I knew what this meant, I might do it.

If you have another active patching situation, it might be wise to extoll the virtues of the -b option with serialized backups until the issue is resolved.

You have a URL for that?

Triskelion’s picture

Try man patch (assuming linux)

patch -b will create a backup of your original file as it patches the new one. It used to be the default behavior for patch. Now you have to specifically enable it.

Thanks again.

agentrickard’s picture

Status: Needs review » Fixed

This has been committed to 5--1 and to HEAD. Thanks, all!

Anonymous’s picture

Status: Fixed » Closed (fixed)

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