When using the "Available on current domain" on a content view, any content that was present before the addition of domain will not be shown for the default domain, even though it is technically published to the default domain.
This is because the domain related fields have no value yet, which basically means it is published only to the default domain.

Also, as this filter adds the distinct option by default. This should not be done IMO as it is up to the administrator to add this. Adding this also causes problems with some views like the general content view.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

L_VanDamme created an issue. See original summary.

L_VanDamme’s picture

Status: Active » Needs review
FileSize
2.41 KB

Adding my own patch to get things started

L_VanDamme’s picture

FileSize
2.16 KB

Small fix for the patch

agentrickard’s picture

Did you "rebuild node access" as instructed after installing the module?

I also disagree. No domain information does not mean "published to the default domain."

agentrickard’s picture

Category: Bug report » Support request
Status: Needs review » Postponed (maintainer needs more info)

This is not a bug. When you install the module, core prompts you (on all admin pages) to rebuild node access.

Saving a node with no domain assignments (view the UI), assigns it to the default domain. See line 83 of domain_access.module.

    // If there are no domains set, use the current one.
    $domains = \Drupal::service('domain_access.manager')->getAccessValues($translation);
    /** @var \Drupal\domain\DomainInterface $active */
    if (empty($domains) && $active = \Drupal::service('domain.negotiator')->getActiveDomain()) {
      $domains[$active->id()] = $active->getDomainId();
    }

Is this _not_ the behavior you see after rebuilding node access?

agentrickard’s picture

Category: Support request » Bug report
Status: Postponed (maintainer needs more info) » Needs review

My apologies, I get a lot of false bug reports because people don't rebuild node access.

I just looked at the logic of the patch, and the problem is indeed with how Views handles this case.

Our node access records are stored properly, but there is no data in the node field.

This approach is probably easier than adding default values to all existing nodes on install, but I wonder if we should be doing that as well? Probably not, because we end up chasing dependencies in that case.

agentrickard’s picture

I also see that this addresses the // @TODO proper handling of NULL? comment, which is great.

I think at this point we should leave the DISTINCT. Taking it out would require all Views written with this module to be edited. Removing it also creates a bit of a support nightmare, as everyone will be asking why there are now duplicates in their views.

What about that DISTINCT causes issues with other Views?

artis’s picture

Version: 8.x-1.0-alpha16 » 8.x-1.x-dev
FileSize
2.5 KB

Rerolled patch #3 without removing DISTINCT from the query per comment #7.

  • agentrickard committed 9adf960 on 8.x-1.x authored by artis
    Issue #3100227 by L_VanDamme, artis: "Available on current domain" does...
agentrickard’s picture

Status: Needs review » Fixed

Committed! Thanks!

Status: Fixed » Closed (fixed)

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