The function ctools_context_get_context_from_context() invokes the context creation function with the $empty parameter set to TRUE when $type is 'requiredcontext'. I wonder why that is.

I am trying to get the Panelizer preview to work on OpenAtrium and I already have applied patch #2797449 on CTools 1.12. The panelizer display contains a pane with a required entity context. When previewing, the context is empty only because ctools_context_create_entity() returns an empty context as $empty is true.

To me it seems that ctools_context_get_context_from_context() should not invoke the 'context' plugin function with $empty = true when the argument was successfully applied to the $context.

I have tested this on an installation with CTools 1.12 patched with several OpenAtrium/Panopoly patches and patch #2797449. However, the code in context.inc does not seem to differ from current 7.x-1.x so I assume my observations apply to 7.x-1.x as well.

Comments

Jorrit created an issue. See original summary.

jorrit’s picture

Status: Active » Needs review
StatusFileSize
new2.36 KB

The attached patches fixes this issue. I added a test to tests/context.inc and I renamed the test class to be more generic. I hope this is OK.

jorrit’s picture

StatusFileSize
new2.36 KB

Update to latest ctools dev version.

Status: Needs review » Needs work

The last submitted patch, 3: 2861041-ctools-requiredcontext-3.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

jorrit’s picture

Status: Needs work » Needs review
StatusFileSize
new2.43 KB
joelpittet’s picture

Version: 7.x-1.12 » 7.x-1.x-dev
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.