Hi there,

I've been trying to get this right, but i don't seem to be able to.

I have a site, say for example, mysite.com, with subdomains store.mysite.com and community.mysite.com

I would like to, within my content type settings, specify which subdomains they should appear by default.

For example. If I want all blog entries to automatically be assigned to the community subdomain, so when a user creates blog entries they shouldn't even see the domain access frameset.
If I create a product the same thing should happen but for the store subdomain.

And finally if I assign multiple subdomains to a content type then checkboxes should appear for me to select which subdomain that content should be added. Like setting the page content type to both the store and community subdomain, then the frameset in the create page form should appear.

Does anyone know how I could accomplish this. Isn't this something that should be part of the domain access module?

I want to keep the create content forms as simple as possible, so fewer the unneccessary framesets the better. Also, if a user is creating a blog entry they should be given an option to publish it in the online store when is clearly belong in the community domain.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

agentrickard’s picture

Category: support » feature

This is actually a feature request, because it will require code.

By 'frameset' I think you mean 'fieldset' in the form. If not, please clarify.

This use case makes sense, it just was never requested to be configured by content type.

Currently, something similar is supported based on the domain a user is assigned to and the permissions that one has. See the information in section 4.2.2 'Content Editing Forms'. If a user is registered to community.example.com, you can force all of their posts to be made from this domain.

If you need to do this per content type, then we need to look at some changes via hook_form_alter(), either in the main module or in a submodule.

migueljds’s picture

Ah, ok. Thanks.

I saw the content editing forms in the documentation, however I'd prefer to give users access based on content type rather than assigned subdomain.

I need this feature quite soon, so it looks like I'll have to code it in a sub module then.

agentrickard’s picture

Take a look at domain_form_alter() then for ideas about how this might work.

I can see putting your logic into that function, or create a new module 'domain_nodetype' and execute hook_form_alter() there. The new module would fire after domain_form_alter() in Drupal's hook sequence, allowing you to edit the default behavior.

If we added this to the core, it would go into lines 1033-1149, adding (probably) a new IF check, which might require a new permission or setting. This code is relevant to what you want to do:

          // 2 == go to the user's assigned domain.
          case 2:
            $domain = domain_lookup($first_domain);
            if ($domain['domain_id'] != $_domain['domain_id']) {
              domain_goto($domain);
            }
            break;

I think it might be best to do this in a separate module, since the base use case works for most people and the admin settings are already very complex.

excell’s picture

I have exactly the same need - to be able to assign content types to specific domains only...
but I don't know how to write a module to do it.

Similar to the original poster the content types need to be added to the appropriate domain and I don't want the users to have any choice or to get confused. Users in my case could have access to multiple domains - when they click create content the content type needs to be automatically posted to the domain it belongs to.

Otherwise I have to go around and check what is going on all the time and reassign the content - too hard :)

Please let me know if anyone gets to write a module for this please.

Thanks for all your hard work.

agentrickard’s picture

Do these rules apply to all users? To users by role? By permission?

nirvanajyothi’s picture

This is probably a way for doing it manually....I am using 6x...but its the same for the case

From what i understand you want content type 'blogentry' created by all users to be published in

comunity.mysite.com .

For this ,under 'Create content' u can create a custom navigation link in menu,maybe 'Blogentry' pointing

to content form

at comunity.mysite.com/node/add/'blogentry'(so that the user is taken to

comunity.mysite.com's

create content-->content type form)and thus makin it possible for all ppts created to be shown only in

comunity.mysite.com.

This can also be done for product ie.,make a custom navigation link pointing to

comunity.mysite.com/node/add/'product'

agentrickard’s picture

Yes. In both Drupal 5 and 6 you can replace the standard menu items with custom menu items that are full paths to the domain that you want.

Just create a new menu item and disable the default one.

Still, a more elegant solution might be nice.

agentrickard’s picture

Status: Active » Postponed
apb1991’s picture

Version: 5.x-1.4 » 6.x-1.0

I would like this feature as well.

agentrickard’s picture

Version: 6.x-1.0 » 6.x-2.0-rc5

New features go into 6.x.2. Please patch against HEAD.

Pierre_G’s picture

Version: 6.x-2.0-rc5 » 6.x-2.0-rc6

Hi,

I'd like to know if there was any new things here ?

I'm working with the 2.0-rc6 and I would like to set some default "domain access options" to each of my content types, and not have to edit my content, once created, to change the domain access options.

Is there a solution ?

(Thanks for all your work by the way !)

agentrickard’s picture

There are several possible solutions, but no one seems to be coding them at the moment.

I am busy with #443296: Tasks for stable release

Pierre_G’s picture

Can give me a clue about those possible solutions? Maybe I can have a look in the code if I find some time.

Good luck with all the work !

agentrickard’s picture

See #3 above

Pasqualle’s picture

+1
I hope this would work as "Default source domain" also, when "Rewrite all URLs to point to a single source" is enabled..

arlind’s picture

I would like this feature as well - my site is up and running, and this feature is would enable a community-subdomain, which currently no module does.

Bo :-)

Anonymous’s picture

+1 to this functionality, it is needed when users can make different content types which are supposed to only be shown on certain domains.

Anonymous’s picture

FileSize
1.62 KB

I took a swing at this and got some things hammered into a module. It is doing what I intended it to do, maybe it can help someone else, so I will post it here:

nirvanajyothi’s picture

will be trying this out. thank you for sharing.

agentrickard’s picture

@wildkatana

I really do not understand your approach. I am worried about the DELETE statement in hook_domainrecords(), which is not needed. The records in {domain_access} get updated based on what is returned by this hook already (see _domain_store_grants). You are also defaulting all content to 'all affiliates', which may not be desired and contradicts some other module features.

If you want to change the records for existing nodes, that should go into hook_enable() or an update hook.

I was also thinking about this yesterday, and if I wrote it, I would just use hook_menu_alter() to change the 'node/add' permissions callback to a domain-sensitive function. I would likely also put the configuration options on the Node type form, which is Drupal standard. Alternately, I would use hook_from_alter() to add the settings to the domain editing form ($form_id = domain_form).

Anonymous’s picture

@agentrickard

Yes, the solution I posted was admittedly tailored to my needs, and I was hoping someone else could use it as a guide to help them. The reason I have the DELETE statement there is because I was getting errors without it. As for defaulting to all affiliates, that is also what I needed because I needed the content to show in all views on all domains, while still being associated with only one domain for the link.

I also thought about doing the hook_menu_alter thing, but I am using this for Content Profiles, and thought that since it is not a node/add path that it wouldn't work. However, I do not know exactly how that module works and so I would be willing to give that a shot as well.

To restate, the functionality I wanted was to have views on different domains still show the content, but have the link to the node always point to it's default domain. And I have multiple content types that each need to be defaulted to a different domain.

I also thought of putting the default domain on the node type forms, but this was faster and I was just plain too lazy to do it ><.

agentrickard, could you provide an example of what you mean using the hook_menu_alter() function? I would be willing to remake this module properly and give others here a good solution they can use.

Pasqualle’s picture

Version: 6.x-2.0-rc6 » 6.x-2.x-dev
Component: - Domain Content » Code
Status: Postponed » Needs review
FileSize
1.45 KB

the module as described in comment #3

Anonymous’s picture

@Pasqualle : I have tested your module and on the UI part it is perfect, but I've had some trouble with the functionality. What I'm trying to do is make it so that a specific content-type will always only display on a specific domain, and if it is accessed from a different domain, it will redirect to that content-type's default domain. Can this be done with your module? If so, can you explain? Thanks!

Sincerely,
Leighton

Pasqualle’s picture

No, this module does not change that logic. Source domain per content type is not implemented in the attached module..
I was thinking about the same in comment #15.. Default domains can be more, but source domain is only one, so it is a little bit different issue.

The only option for now is to redirect to one selected domain (that is already part of Domain Access module).

Anonymous’s picture

@Pasqualle
I see. I ended up using your module and added a hook_nodeapi to check the domain and redirect if it was not on the default domain.

@agentrickard
I looked through the API on your site trying to find a function i can call to get the current domain id, but couldn't find any. I am probably just overlooking it, but can you tell me what it is?

agentrickard’s picture

$GLOBALS['_domain']. Though we probably should make a function for that.

Anonymous’s picture

That's a much cleaner way of getting the domain id than what I was using. If anyone is interested, I added this function to Pasqualle's module to redirect content-types to their default domains:

function domain_nodetype_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) {
  switch ($op) {
    case 'view':
      $domain = domain_lookup($GLOBALS['_domain']);
      $defaultDomains = domain_nodetype_default_domains($node->type);
      
      //Check if the current domain is the default domain for the content-type, if not then redirect to the default domain
      if (!in_array($domain['domain_id'], $defaultDomains)) {
        $domain = domain_lookup($defaultDomains[0]);
        $pageURL = ($_SERVER["HTTPS"] == "on") ? 'https://' : 'http://';
        $pageURL .= $domain['subdomain'] . $_SERVER["REQUEST_URI"];
        drupal_goto($pageURL);
      }
      break;
  }
}

But I would like to rewrite the links in the views to the default domain so that less redirection is necessary. Any ideas on how to do that?

agentrickard’s picture

You might just be able to use domain_goto(), which does much of this for you. I don't know the structure of $defaultDomains. domain_goto() expects a $domain array as an argument. So at least you can do:

      if (!in_array($domain['domain_id'], $defaultDomains)) {
        $domain = domain_lookup($defaultDomains[0]);
        domain_goto($domain);
      }
Anonymous’s picture

@agentrickard
I originally WAS using domain_goto just like you have it there, but sometimes it was redirecting strangely. I think it has something to do with my having the url_alias table prefixed for different domains (which I'm starting to think is NOT a good idea). In any event, the code I posted breaks any pages which display more than one node, so I had to disable it just now. Still looking for another workaround

-Leighton

agentrickard’s picture

You should be able to check the $a3 and $a4 value to see that you are on a Page instead of a Teaser view, and then only redirect on a page view.

If you are using separate url_alias tables for domains, then you may want to do a goto node/NID, and Drupal will fix the path for you, I think.

There is also a hook_domainpath() for cases like this, but use it sparingly. If you used Domain Prefix to handle the {url_alias} table, this should be handled for you if you call url("node/$node->nid") in your code. Then run drupal_goto() on the result.

Anonymous’s picture

@agentrickard
I had tried the $a3 and $a4 thing as well but they weren't fixing the problem I was having (I was still just getting a WSOD on the front pages of all the domains, I didn't test it with view pages actually, so the problem may actually be something to do with front pages instead of views like I thought). It could also be that in many of my tpl files I call node_view() on specific nodes, which is sloppy but that is what seems to work best for my circumstances. The prefixed url_alias tables weren't causing problems with the regular pages, they were redirecting to the correct paths even with node/nid, so I am thinking the problem was more something to do with either the node_view() in my tpl code or something I don't know about concerning front pages. I'll try and test it a bit more and report what I find.

agentrickard’s picture

With reference to #25 and #26, see #504528: Add domain_get_domain()

agentrickard’s picture

The likely problem is node_view() in the theme files, which may be inconsistently setting $a3 and $a4.

Pasqualle’s picture

Status: Postponed » Needs review

I have updated the module in comment #22. The default domain settings were not applied when the node is created automatically (not through the node edit page).

the module can be downloaded from here: [removed]

still no redirection is implemented in this module.

---
edit: download link removed

agentrickard’s picture

Status: Needs review » Postponed
zserno’s picture

FYI: Pasqualle's solution has been released as a separate module.
Please take a look at it: http://drupal.org/project/domain_nodetype
Feedbacks are welcome.

agentrickard’s picture

Status: Needs review » Fixed

Hooray!

In D7, btw, this becomes much easier.

Status: Fixed » Closed (fixed)

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

xjm’s picture

Awesome! Thanks zserno & Pasqualle.

mxh’s picture

Version: 6.x-2.x-dev » 7.x-3.3
Status: Closed (fixed) » Needs work

#37:
could not find this functionality in D7 yet.
agentrickard, if there is still no functionality for this planned, I will write a module for D7 (similiar like domain_nodetype). Please answer which plans you have on this. Thanks :)

agentrickard’s picture

I have no plans. Though there might be an open feature request.

I would accept a patch as well.

agentrickard’s picture

Status: Needs work » Active

The "needs work" status only applies to patches.

mxh’s picture

All right thanks! I will work on a patch then and post it here.

mxh’s picture

A first try.

The idea of this patch is to add a 'Node defaults' settings page in /admin/structure/domain/bundles.

I moved the 'create new node' behaviour and 'publish to all domains' settings from the domain_configure_form to the Node defaults page.

New features
- set up if the currently active domain is assigned to your node automatically
- set up to which domains the node is published on default.

This should fit the feature request.

@agentrickard: I developed this on 7.x-3.3 first, commited to 7.x-3.x-dev then, hope this works :/

attached patch is old.

mxh’s picture

Status: Needs work » Active
FileSize
9.87 KB

oops, forgot a little fix in the new function. please test this attached one.
old patch, not recommended.

agentrickard’s picture

Status: Active » Needs work

Proper status.

This also needs tests, though domain_node_get_default_affiliates() should make that easy,

mxh’s picture

Yes, could you tell me how to perform the tests? I'm new in providing patches.

mxh’s picture

Status: Active » Needs work
FileSize
10.05 KB

Tested with Feeds importers, works correct with attached patch.

mxh’s picture

*sigh* Should have cleaned up the code earlier.. here it goes again with cleaner code in domain_node_get_default_affiliates() and my changes in domain_node_access_records().
Ready for testing now :-)

agentrickard’s picture

The patch needs to be cleaned up for coding standards. I'm seeing a lot of inconsistent indentation.

mxh’s picture

sorry about that :(
fixed:
- replaced tabs with whitespace
- corrected function calls
- corrected code structures

Coder module now reports no warnings regarding this patch. If I missed something important regarding coding standards, please tell me. I appreciate a lot that you take the time for this, many thanks :)

agentrickard’s picture

Just little things. This comment, for instance, should be a complete sentence, with proper capitalization.

// get the default affiliates, use currently active domain as fallback
mxh’s picture

Next try :)
fixed comments

agentrickard’s picture

Status: Needs work » Needs review
mxh’s picture

please excuse my mistakes. I had forgotten to add the new persistent variables to variable_del in hook_uninstall. Now there they are. Tested the uninstall process, working fine on my dev environment.
In future I'll be more careful.

agentrickard’s picture

Status: Needs review » Needs work

This UI needs a lot of love. I'm testing with a dozen domains, and it's pretty hard to use. That said, I'm not sure how it might be improved.

I suspect that the old show/hide behavior for the default radios needs to go away as well. I think these new settings replace the old ones.

mxh’s picture

FileSize
27.98 KB

I thought a lot about the UI. The node defaults page should stay, because you should be able to configure everything regarding the Domain Access module on admin/structure/domain. It's difficult to find an agreement for easy use between number of domains and number of bundles.

I think a good solution would be to additionally provide configuration of the domain access settings at the view of the bundle, accessable like in the attached screenshot. On the field edit page you have the domain field rendered like in the node_edit_form, and there you can set up the default values.

Unfortunately I don’t know if my proposed solution is even possible, because node->domain is a pseudo-field, and I could not find the method to add a edit page for pseudo-fields.
I can investigate further, if you think this solution would be nice.

The D6 module Domain node type already does it this way, but the configuration appears on the node settings page like in the screenshot. So this definetly would work, but I'm not sure if you like it.

I suspect that the old show/hide behavior for the default radios needs to go away as well. I think these new settings replace the old ones.

Please confirm that I understand it right: The radio buttons for "Show on all affiliate sites" and "Only show on selected sites" should be removed, instead "Send to all affiliates" are checked by default when the user makes no changes at this, right?

agentrickard’s picture

I think the Domain Node Type pattern is what we need to support. We can replicate those settings in Domain Conf if we choose to. Or we can build something that looks like the User Defaults tab, using a table for easier scanning.

Yes, I think the radio buttons need to be removed in favor of the new settings, which are more granular.

mxh’s picture

User Defaults' table is good. I also thought about this, but switched to the current (fast) solution then. I was worried about when you have about 50 bundles, the table may explode so we'd have to create multiple tables. Uhm.. but why not, I also think it's far better than the current one, plus User defaults and Node defaults look similiar to each other then.

Okay so I will write a new patch, currently planned with following changes:

- Remove the radio buttons
- Change the domain_node_[node_type] variables to arrays, containing:

['all'] -> 0 || 1
[domain1_machinename] -> 0 || 1
[domain2_machinename] -> 0 || 1
...

so that we can get the default info whether the node is published to all domains and to which domains the node will be published / belongs to.

- Build form similar to User defaults, creating new table for every 15 (I think that's ok) node types
- Provide specific domain access settings on the node type configuration pages. The settings will appear straight in the vertical tabs just like in D6 node_type module.

I think this would be the proper solution. Do you agree?

Edit: Updated regarding #60. Will provide the patch soon!

agentrickard’s picture

In the 7.x.3 branch, I suspect the keys for those domain settings need to be the machine_names, for exportability.

Otherwise, this looks good.

mxh’s picture

Status: Needs review » Needs work
FileSize
17.16 KB

Sorry for the delay, I was busy this week. New suggestion see attachement.

This patch needs to be tested. Unfortunately, I'm not familiar with drupal's testing methods.
If someone is good in that, please feel free to adapt this patch for the automated patch testing.

Furthermore, please make sure that the radio replacements are set correctly. I've tried very hard to fit everybody's needs in that. Since there shouldn't be a use for domain_behavior anymore, I marked this in domain_uninstall(). Sometimes, only DOMAIN_INSTALL_RULE is left for setting things up. Of course these changes can be easily seen in this patch.

mxh’s picture

Status: Needs work » Needs review
mxh’s picture

I need to add an update method.

mxh’s picture

Status: Needs work » Needs review
FileSize
17.88 KB

Attached patch is not recomended. Try #65 instead. Please excuse my mistakes.

mxh’s picture

Here it is, ready for testing.

mxh’s picture

What's the next step? I can't find here on drupal.org where to put this patch for testing. I think automated testing is disabled here.

agentrickard’s picture

It is, because you have to edit settings.php for DA to work. The tests have to be run on a machine that can handle DA.

I've been out on vacation.

mxh’s picture

Ok, so I just have to wait until it is tested on your machine, right?
I wish you a nice remaining holiday!

docans’s picture

Status: Needs work » Needs review

Great work you guys. I have applied the patch manually and it works great and it is exactly what i was looking for, so far so good.

i think it would be wonderful if the patch can be added into the module after further testing.

Once again Great work

agentrickard’s picture

Status: Needs review » Needs work

There are some cleanups I'd like to see. The most glaring issue right now is the function domain_settings_node_access(), which has to be changed because it is a core hook for the Domain Settings module.

The help text needs a good editing.

mxh’s picture

Status: Needs review » Needs work
FileSize
18.14 KB

This function name was stupid, excuse me. I have to mention that I'm not good in english, and don't have much freetime anymore (my exams are coming soon). I'd like to ask for someone who has more (say a lot) experiences in developing for drupal to create a good patch for this. I don't know if this one would ever be ready for a commit. Anyway, fixed the glaring issue and tried it with another helping text.

mxh’s picture

Status: Needs work » Needs review
agentrickard’s picture

I think this just needs a cleanup. There are some inconsistencies in the text, but the functionality seems to work fine.

I am not entirely clear on the purpose of "Editor's current domain" setting, however.

mxh’s picture

Version: 7.x-3.3 » 7.x-3.x-dev
FileSize
18.22 KB

I changed the setting's text to "Author's currently active domain", which should be easier to understand. This setting should stay because the feature already existed before (This was in your default domain behaviour). I (and many others for sure) need this setting.

I've checked my comments and variable names, I don't know further improvement anymore. As said before, I'd ask for someone who's better in that.

agentrickard’s picture

I just need to clean this up; but I'm really busy :-(.

Thanks!

docans’s picture

Title: default domains for content types » A module for all
FileSize
160.81 KB

Hi

Attached is the patched domain module for default domains with the patch from comment #65 patch 1.

Just download and intall the domain module as required in the documentation and it will come with the default domain settings

Hope you like it

mxh’s picture

Title: A module for all » default domains for content types

docans, please read and follow instructions from Making an issue report. We don't need various versions of modified modules here. Please make the purpose of drupal issues and patches clear to you. Thanks.

#74 is the current one to be tested, which will be cleaned up and will be committed to 7.x-3.x.

agentrickard’s picture

docans’s picture

Sorry, if my contribution was not needed, just wanted to help. Is there a way i can delete it. Sorry for any inconvenience.

agentrickard’s picture

No worries.

docans’s picture

Title: default domains for content types » Has this feature been included in the new release of 7.4

Hi

I will like to know if the default domains for content types feature has been included in the new release

Thank you

mxh’s picture

Title: Has this feature been included in the new release of 7.4 » default domains for content types

docans, please do not change the issue's title. This is not a title of your comment, it's the title of the issue you are changing. If not yet done, please read links given in #77 and #78.

As seen in the release notes, this feature is not yet included.

This patch needs to be tested and reviewed before it can be commited to 7.x-3.x branch. And as written in #75, the patch code has to be cleaned up first.

agentrickard’s picture

Status: Needs review » Needs work

And I was thinking about this one today. I had forgotten to check that we are using machine_names as keys. We are, but I don't understand the need for a prefix. Machine names are already unique, and this is a domain-specific setting.

$options['domain_' . $value['machine_name']]

Using the prefix here is just potential cruft, because we have to handle conversions within domain_get_node_defaults()

mxh’s picture

I used the prefix to prevent the case when someone calls his/her types with machine name 'all' or 'active'. And I wanted to have 'all' and 'active' setting in one variable per type.

I also thought about storing a variable for 'all' which whould contain the setting for every node type, same thing for 'active'. Then the prefix wouldn't be neccessary, but I'd have to call variable_get() three times: For 'all', 'active', and the node type. Then I'd have to build settings array by merging the needed values with the stored settings variable for the node type. For me the prefix was a more comfortable compromise, and I think the Saviours are different for the way of implementation.

Someone else may feel free to do a more elegant implementation. Currently I am busy with study, exams and project work :/

agentrickard’s picture

Thanks for the explanation. I think the solution is to change the other two to "domain_all" and "domain_active".

mxh’s picture

What about using uppercase DOMAIN_ALL and DOMAIN_ACTIVE? Might be a little bit confusing since those are no constants but machine names must not have uppercase letters -> no propability of conflicts.

docans’s picture

Title: default domains for content types » I just asked a question

To maxelli :
I was just asking a question and you have replied, what problem do you have with the title of my comment

docans’s picture

Title: I just asked a question » Another Question

i will like to know if i can apply the patch in #76 to domain 7.4 and it will work as expected or i should wait until the feature is added to the next release

Thanks

mxh’s picture

Title: Another Question » default domains for content types

docans,

either you don't understand what I told you in comment #82 and before, or you just don't read carefully.
Once again (last words on this):
The title you've changed here is the issue's title. You cannot set a title for your comment here.
Feel free to ask and comment, but just leave the title here unchanged.

Answer to #88: If it's a productive live site, don't apply the patch and wait until the feature is included. You may try this patch on a test environment and report us here if there are problems coming from this patch.

docans’s picture

Title: default domains for content types » Understood the title issue

To maxelli

Thanks for the reply, i did not know that i am not supposed to use the issue title for my comment title.

Secondly about #88 , the site i am working on is not yet a productive site but it will be soon. It is already online on one of my servers.

If you dont mind can i go ahead to update the domain to domain 7.4, apply the patch and get back to you on the results and i can give you the link to the website if you are intrested

What do you think

mxh’s picture

Title: Understood the title issue » default domains for content types
bwinett’s picture

LOL

mxh’s picture

Status: Needs work » Needs review
FileSize
18.27 KB

Next try, no domain_ prefix anymore and written for latest dev.

docans’s picture

To Maxelli

I have applied the patch to the latest dev dated (2012-Jun-01) and applied it to my website. So far so good, no error.

The only issue is that i had to reconfigure my menus and content type back to their default domain after i updated to the dev with patch. Looks like the default settings were not saved in the database or ported into the update. But its all good. Just a few minutes of re-editing.

Good job done

Thanks

rogical’s picture

I want to have nodes 'Send to all affiliates' and set 'souce domain'.
dd

But both are not set.
dd

  • After apply this patch, nodes seems will not be able to publish to current domain(without setting a specific domain) while not user active domain.
  • Can we make the default setting the same with 'DOMAIN ACCESS OPTIONS'?
rogical’s picture

Title: default domains for content types » Setting default publish to domains and source domain for content types

I think this would make sense, as users can register on any domain, while they uaually want to publish node to current domain.

mxh’s picture

Title: Setting default publish to domains and source domain for content types » default domains for content types
Status: Needs review » Needs work

rogical, which version of Domain Access and which version of the patch are you using? Did you run update.php immediately after applying the patch with Git? Do your users have a role which contains the right to publish nodes to all domains?
Default Domain Source options are not handled here, only default publishing options. Please open a new issue if you want a feature like this, thanks.

•After apply this patch, nodes seems will not be able to publish to current domain(without setting a specific domain) while not user active domain.
•Can we make the default setting the same with 'DOMAIN ACCESS OPTIONS'?

Unfortunately I don't understand what you mean.

docans’s picture

Title: default domains for content types » default roles for new registered users no longer available

I Have recently discovered that when a new user create a new account. The account is set to active but it is not assigned to any role automatically.

I have created a role called [ Basic Member ] but can find the options to set newly registered user to be assigned to the [ Basic Member ] role. So New users get [ Access Denied] any time they try to access the node/add page to add a content.

When i check their people link at (/admin/people) it show the new user but the status is empty meaning it has not been assigned to any role, not even as an [authenticated user]

Secondly i can no longer locate the set default role for new registered user

Please help me locate this option and make the necessary correction

Thanks

mxh’s picture

Title: default roles for new registered users no longer available » needs review
mxh’s picture

Title: needs review » default domains for content types

I'm getting tired.

docans’s picture

Title: default domains for content types » default roles for new registered users no longer available
FileSize
52.73 KB
124.07 KB

Attached are some screen shot to issue #98

Note on the People list.jpg
1. The " Mark " user is a newly created user created my the user himself on the user registration page
2. The " Dela " user was created by administrator so the user was assigned to the [Basic member] by the administrator

The problem as stated above is to automatically assign users who create account using the site user registration page to be automatically assigned to the [Basic Member]

Thank you

mxh’s picture

Title: default roles for new registered users no longer available » default domains for content types
docans’s picture

Title: default domains for content types » default roles for new registered users no longer available

To maxelli

Please dont get tired. We will all try and figure it out, that is why we are a community. All the best.

mallezie’s picture

Title: default roles for new registered users no longer available » default domains for content types

Changing title back.
@docans. Please don't change title. If you have another question / problem. Pleas open an new issuu.

I'll test and review patch today.

mallezie’s picture

Patch basicly works.
1 warning:
domain.module:
argument of array_flip is not an array
line 3986 added extra if does the trick:

if (is_array(domain_default_node_access_settings($type))) {
    $settings = array_flip(domain_default_node_access_settings($type));
}

Otherwise looks good according to me. Also some trailing whitespaces

mxh’s picture

When did it occure? I assume you run update.php immediately after applying the patch? Before you added extra code, did it occure regurarly or once? Thanks for your feedback!

mallezie’s picture

Status: Needs work » Reviewed & tested by the community

My mistake. I reapplied. And run update.php.
No error's found.

mxh’s picture

Never mind, thanks for testing again.

agentrickard’s picture

Reviewed and cleaned up the following:

  • Content type editing page mismatched the 'DOMAIN_ALL' value from the Domain settings page.
  • Turned DOMAIN_ALL and DOMAIN_ACTIVE into defined constants for clarity.
  • Menu order was incorrect. Fixed.

Can likely commit, then add tests.

mxh’s picture

Good news. Looking forward for the new feature and I want to say thanks to agentrickard for your patience. I really appreciate your help, I have learned a lot. I hope in future I also can provide some useful patches for you to make this awesome module even more awesome.

agentrickard’s picture

I think you've been more patient, waiting for me to review things.

Next step will be updating the documentation. I'm working on some tests.

litvinova_yana’s picture

Hi, everyone!
I'd like to know how soon will we be able to get this feature in the module itself? I mean, I do not want to "hack" the module files now with the patch, because the necessary feature will be removed when updating... But I need it so much!

andros’s picture

Would really appreciate a release for of this feature as soon as possible too.

agentrickard’s picture

Then please write a test.

agentrickard’s picture

Status: Reviewed & tested by the community » Fixed
FileSize
27.32 KB

Committed, with tests. Nice work!

agentrickard’s picture

Title: default domains for content types » Document: default domains for content types
Category: feature » task
Status: Fixed » Active

So, who's up for documentation on this one?

mxh’s picture

Sorry, I've been absent for a while, at the moment I'm on vacation.

I'd like to write a documentation for you, but I don't know how to properly give you the needed data. Do you have have a link for me with a tutorial how to correctly write documentaions for Drupal modules? I could write a chapter for the README if you need this.

Offtopic: I'm going to travel to California from August, 21st until September, 11th. My girlfriend an me will drive from San Francisco, down to San Diego, then to Las Vegas and back to SF. May someone is on the way, who's an experienced Drupal developer, and/or works at a company for internet services. I'm interested on a work experience in USA for my study. If anyone is interested, or just wants to have a nice conversation with a German guy, just write to me, thanks!

agentrickard’s picture

See https://drupal.org/node/700538 and just add a sub-section to https://drupal.org/node/1121614 using the style of that page.

docans’s picture

I will like to know if the default domain feature has been commited to the 7.x-3.x-dev version. If not when will it be committed. Thank you

rogical’s picture

careless, see #115

agentrickard’s picture

And I'd like to get it documented before rolling a release.

mxh’s picture

Status: Active » Needs work

Sorry, I am busy on my vacation, but now I've just spent some time for documentation.
Updated Node Access 'Assigning Domain Access' section and added sub-section to Advanced Module Configuration. I hope it's ok so far, but I think some grammar correction is neccessary. Sorry for that.

docans’s picture

I have time, and i will like to help with the documentation. What can i do to help

mxh’s picture

You could help me with reading these parts of the documentation: https://drupal.org/node/1121614#contentdefaults & https://drupal.org/node/1096982 (only the section Assigning Domain Access) and then tell me if you understand it. You could also tell me if something important is missing.

agentrickard’s picture

That's a real nice start. Does need a reviewer other than me to check for clarity, though.

docans’s picture

Thanks. I will check them out and get back to you

mxh’s picture

Some of you seem to need a lot time to check 14 lines of documentation, huh?

agentrickard’s picture

@hauptm

And what have you done to move this forward?

Please, think before you speak.

mxh’s picture

I can hardly say that my own documentation for this feature is understandable and complete for everyone. So what I have done is waiting for almost 2 months to get feedback, as posted in #126. As we have 20 followers here, 17 other persons could have checked in this time. So I thought before speaking, but thanks for the hint. Also,#127 was not meant to attack anyone of you, it was meant as a jestingly reminder. I'm sorry for the disaccord.

agentrickard’s picture

Status: Needs work » Needs review

No, it's my fault, I didn't read the backscroll to see that you had written the original docs.

My apologies.

mxh’s picture

No worries.

batigol’s picture

Interesting project!

I have running few domains and subdomains and one forum. I have few forum category and thanks to redirection I link them to proper domains/subdomains, for example:

forum category computers move user to computers.mypage.com/forum/computers and forum category drupal move users to drupal.mypage.com/forum/drupal. The problem is when users making new forum topic in computer forum section, it should be created with source domain - computers.mypage.com and again if they create a drupal topic the source page should be drupal.mypage.com

So if I get this right thanks to this patch I can make it work just fine ?

mxh’s picture

No, this patch is not for the Domain Source submodule. It only handles default publishing options for nodes.

batigol’s picture

Ohh,ok. Thanks for clarifying this out.

agentrickard’s picture

Title: Document: default domains for content types » Default domains for content types
Category: task » bug
Status: Needs review » Needs work

I was just looking at this code in light of #1616402: Convert domain_roles to use machine names, and it doesn't appear to me that the update hook actually converts old settings from using domain_id to using machine_name.

That seems like a pretty big oversight.

agentrickard’s picture

Status: Needs work » Closed (fixed)

Wait. Ignore that. Those are new settings ;-p/.

mxh’s picture

Title: Default domains for content types » Document: default domains for content types
Category: bug » task
Status: Closed (fixed) » Needs review

That's a real nice start. Does need a reviewer other than me to check for clarity, though.

I think this task is still open for this one.

agentrickard, feel free to mark it as fixed again if you think the documentation is good enough so far. I just don't want to let things being overseen.

agentrickard’s picture

Status: Needs review » Fixed

I like the online docs. They could be improved but are not a blocker. Thanks!

Status: Fixed » Closed (fixed)

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