A number of modules need certain generic form steps from CTools. These include:
Mini Panels,
Page Manager,
CTools Condition Ruleset

If we make these forms generic enough for use across all of these with minimal developer effort, we may find they end up included in many other modules as well.

Eclipse

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

EclipseGc’s picture

Status: Active » Needs review
FileSize
29.88 KB

This is a first pass at the code involved. It's not completely abstracted properly yet, mostly around the notion of the condition and context keys in the cached_values. Need to abstract that properly so that subclasses have complete control over it and get all the docs squared away. I'm using this actively with my CTools Condition Ruleset rewrite.

Eclipse

EclipseGc’s picture

FileSize
32.46 KB
13.2 KB

Further abstracting work. I need to get this working in a non-js environment. I think I'm pretty close (famous last words) but I think I'll need at least one more abstract function on the RequiredContext and ManageConditions forms. Once I've got that squared away, I think these will be generic enough for reuse outside of ctools.

Eclipse

EclipseGc’s picture

FileSize
33.1 KB
4.61 KB

Refactoring the wizard key in form_state to use temporary values had implications for the ajax submit handlers. This required me to store the machine name of our entity during buildForm() in order to leverage it during the ajax submission. This was easy enough but took some tinkering. Likewise the next step submit for non-js environments are all in place but could likely use some additional wrapping logic in order to prevent them from needlessly firing. Whatever the case, it's working both with and without JS at this point which is a big win.

Eclipse

EclipseGc’s picture

FileSize
35.06 KB
6.11 KB

Another iteration of changes and fixes. Included this time is the addition of a "machine_name" field to the context configure screens since we need to name the appropriately for the annotation/derivative handlers. These can't just be numeric. In addition to this, there were some "contexts" assumptions that I had missed in the condition forms. They now have an abstract method. In addition to this functionality was added to the condition configure form that allows to it get arbitrary contexts attached to the config entity. This should probably be wrapped in a method so that other implementations can make use of it, but for wizards it works nicely. This allows internal context mappings to be maintained between contexts the entity expects to have and the conditions using them. This will effectively proxy context through one implementation and down into the conditions.

I'm feeling pretty good about these forms and will likely commit them shortly.

Eclipse

EclipseGc’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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