How to reproduce
* Have a panel with some required and an optional argument
* Have a access condition with an optional context
* configure
* the access contision optional context
to get data from
* the panel optional argument
* Call the panel with empty optional argument

Expected: Condition gets empty context
What happens: Condition gets one of the other contexts

Comments

axel.rutz created an issue. See original summary.

geek-merlin’s picture

Status: Active » Needs review
StatusFileSize
new1.16 KB

Patch flying in that fixes this problem by removing some context-guessing code
That code looked scary from the first time i saw it:
* in a well-configured site it will never run
* in a misconfigured site it will guess an arbitrary argument (which may or may not be the right)-:=

japerry’s picture

Huh the original code seems suspect indeed. However, I'm worried what might break if this code isn't there. But #2341363: Relationship with optional contexts does not work really needs this in order to function...

chris matthews’s picture

Status: Needs review » Needs work
Issue tags: +Needs reroll

The 3 year old patch to context.inc does not apply to the latest ctools 7.x-1.x-dev.

Checking patch includes/context.inc...
warning: includes/context.inc has type 100644, expected 100755
error: while searching for:
      }
    }

    // If we had requested a $context but that $context doesn't exist
    // in our context list, there is a good chance that what happened
    // is our context IDs changed. See if there's another context
    // that satisfies our requirements.
    if (!$this->skip_name_check && !empty($context) && !isset($contexts[$context])) {
      $choices = $this->filter($contexts);

      // If we got a hit, take the first one that matches.
      if ($choices) {
        $keys = array_keys($choices);
        $context = reset($keys);
      }
    }

    if (empty($context) || empty($contexts[$context])) {
      return FALSE;
    }

error: patch failed: includes/context.inc:177
error: includes/context.inc: patch does not apply
shubham.prakash’s picture

Status: Needs work » Needs review
StatusFileSize
new855 bytes

Added reroll

japerry’s picture

Status: Needs review » Closed (outdated)

Drupal 7 is no longer supported, closing.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.