In trying to get the Wizard API to edit existing pages in Page Manager, I encountered an issue where the getOperations()
method wasn't able to setup the list of steps for a existing page entity (as opposed to a new page entity).
Basically, the problem is that getOperations()
was using $this->getTempstore()->get($wizard->getMachineName())
to get the entity, but it was being called before there was a chance to set anything in the tempstore. However, in every case, the actual $cached_values
were available to the calling code - so why not just pass them in?
This also makes getOperations()
consistent with getOperation()
and other methods which already take the $cached_values.
Comment | File | Size | Author |
---|---|---|---|
#6 | interdiff.txt | 8.33 KB | dsnopek |
#6 | ctools-wizard-edit-2607552-6.patch | 29.5 KB | dsnopek |
Comments
Comment #2
dsnopekPatch is attached! This still needs tests. Also, we could modify the interface in a backwards-compatible way by giving a default value for $cached_values of NULL, but I'm not sure if that makes sense or not.
Comment #3
dsnopekAlright! I've written some tests for entity wizards that demonstrate the problem I encountered. Here's two patches: one with the tests only that fails, and another with the functional changes that passes.
Comment #5
EclipseGc CreditAttribution: EclipseGc commentedMake these two different wizards. Edit doesn't need to implement the getRouteName() method, and the Add can extend Edit and JUST implement the getRouteName() method.
Remove
Please fix.
Otherwise I think this looks really good.
Eclipse
Comment #6
dsnopekThanks, @EclipseGC! Here's a new patch that addresses the review from #5.
Comment #8
EclipseGc CreditAttribution: EclipseGc commentednew line :-S
...
fixed these on commit.
Eclipse