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.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | 2861041-ctools-requiredcontext-5.patch | 2.43 KB | jorrit |
| #3 | 2861041-ctools-requiredcontext-3.patch | 2.36 KB | jorrit |
| #2 | 2861041-ctools-requiredcontext-1.patch | 2.36 KB | jorrit |
Comments
Comment #2
jorrit commentedThe 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.
Comment #3
jorrit commentedUpdate to latest ctools dev version.
Comment #5
jorrit commentedComment #6
joelpittetComment #7
japerryDrupal 7 is no longer supported, closing.