Send to all affiliates option not working

Created on 26 September 2022, about 2 years ago
Updated 10 March 2023, over 1 year ago

Problem/Motivation

The Send to all affiliates (field_domain_all_affiliates) option does not work

Steps to reproduce

  1. Edit an entity with Domain Access enabled and ensure the current domain is unchecked, but check Send to all affiliates.
  2. View the appropriate page/block, etc. and the entity will not be visible
  3. Go back and edit the entity and check the current domain
  4. View the appropriate page/block, etc. and the entity will now be visible
πŸ› Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

πŸ‡¬πŸ‡§United Kingdom intrafusion Edinburgh, UK

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡³πŸ‡±Netherlands Floris Vedder

    Apparently this part isn't working anymore.

    $this->getFieldsHelper()->filterForPropertyPath($item->getFields(), 'entity:node', 'field_domain_access');
    

    So I solved that with a patch.
    Basically by changing that to:

     $field = $item->getField('field_domain_access');
    

    Keep in mind that the result is slightly different here we only get one field. For more info see the patch.

    -- Alternative solution --
    I also created an alternative solution.
    Where I added an or condition in the filter itself.

          $or = $this->query->createConditionGroup('OR');
          $or->addCondition($this->realField, $current_domain->id());
          $or->addcondition('field_domain_all_affiliates', TRUE);
          $this->query->addConditionGroup($or);
    

    In that way the data in the search api stays unmodified.
    Downside of this solution is that it's always there and not configurable.

  • First commit to issue fork.
  • @nikathone opened merge request.
  • Status changed to Needs review over 1 year ago
  • πŸ‡¨πŸ‡¦Canada nikathone Ontario

    Created a merge request that ensure that the Search API: Current domain can be setup within a group in a view to work with other fields like in the attached screenshot.

  • First commit to issue fork.
  • Status changed to Fixed over 1 year ago
  • πŸ‡ΊπŸ‡ΈUnited States andileco

    Thank you @nikathone - confirming this works with your Views filter grouping.

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

Production build 0.71.5 2024