#2829295: Improve test coverage and function docs: context introduced a regression. The class ctools_context_optional is missing the required property override to FALSE from the parent ctools_context_required class.

This caused page elements on context admin pages to completely disappear.

Solution: define class property default values on the property itself where possible. That way subclasses can easily override them and don't need to copy the constructor.

Comments

klausi created an issue. See original summary.

klausi’s picture

Status: Active » Needs review
StatusFileSize
new1.58 KB

Patch. Still needs tests to make sure that this doesn't happen again.

klausi’s picture

Issue tags: -Needs tests
StatusFileSize
new1.14 KB
new2.72 KB

Now with a unit test.

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

klausi’s picture

Perfect, test only patch failing as expected.

rivimey’s picture

As author of earlier patch, apologies for the regression.
Checked this by eye and it all looks good - thanks for a new test and for demoing the test-only fail.

joelpittet’s picture

Status: Needs review » Reviewed & tested by the community

Thanks @klausi

japerry’s picture

Looks good to me too.

  • joelpittet committed c8dc116 on 7.x-1.x authored by klausi
    Issue #2905885 by klausi: ctools_context_optional regression with public...
joelpittet’s picture

Status: Reviewed & tested by the community » Fixed

Thank you @klausi, I've committed and pushed this to -dev

Status: Fixed » Closed (fixed)

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