Dependency on Domain Access

Created on 14 December 2023, over 1 year ago
Updated 10 February 2024, about 1 year ago

I was wondering what the connection to domain_access is for this module. We are not using domain_access at the moment, and enabling it complicates access queries even if we don't use it to create any permissions. Is it to be able to give users admin access to domain menus?

✨ Feature request
Status

Fixed

Version

3.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States brad.bulger

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @brad.bulger
  • πŸ‡ΊπŸ‡ΈUnited States drpldrp San Francisco, CA

    Is it to be able to give users admin access to domain menus?

    Yes.

  • πŸ‡ΊπŸ‡ΈUnited States brad.bulger

    Would that be better than trying to segregate that functionality into another module?

  • πŸ‡ΊπŸ‡ΈUnited States drpldrp San Francisco, CA

    Yea, I'd rather not spin up a new thing and have to do update funcs and all that.

    Try this patch and let me know how it goes.

  • πŸ‡ΊπŸ‡ΈUnited States drpldrp San Francisco, CA

    Oops, forgot a thing.

    Use this one.

  • πŸ‡ΊπŸ‡ΈUnited States drpldrp San Francisco, CA
  • πŸ‡ΊπŸ‡ΈUnited States brad.bulger

    I've changed my installed copy to dev-3.x so I had to make a couple small changes to the patch to remove code that was already there. It seems to work fine.

  • πŸ‡ΊπŸ‡ΈUnited States drpldrp San Francisco, CA

    I'll probably release these changes in a new version in a few weeks.

    I noticed one more spot that should probably be altered:

    src/Plugin/EntityReferenceSelection/DomainMenusSelection.php:

      protected function buildEntityQuery($match = NULL, $match_operator = 'CONTAINS') {
        $query = parent::buildEntityQuery($match, $match_operator);
        if ($this->moduleHandler->moduleExists('domain_access')) {
          $config = $this->getConfiguration();
          $menu_domains = $config['menu_domains'] ?? NULL;
          $domain_access_field = defined('DOMAIN_ACCESS_FIELD') ? DOMAIN_ACCESS_FIELD : DomainAccessManagerInterface::DOMAIN_ACCESS_FIELD;
          $domain_access_all_field = defined('DOMAIN_ACCESS_ALL_FIELD') ? DOMAIN_ACCESS_ALL_FIELD : DomainAccessManagerInterface::DOMAIN_ACCESS_ALL_FIELD;
          if (!empty($menu_domains)) {
            $group = $query->orConditionGroup()
              ->condition($domain_access_field, $menu_domains, 'IN')
              ->condition($domain_access_all_field, '1');
            $query->condition($group);
          }
        }
        return $query;
      }
  • Status changed to Fixed about 1 year ago
  • πŸ‡ΊπŸ‡ΈUnited States drpldrp San Francisco, CA

    Fixed in 3.6.0.

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

Production build 0.71.5 2024