Closed (fixed)
Project:
Switches
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
27 Oct 2018 at 13:16 UTC
Updated:
14 Nov 2018 at 01:04 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
robpowellSince we are making schema changes w/o an update hook, you have to uninstall module, update code and then re enable.
known issues:
Next steps
Comment #3
sluceroNice work on this! I ran through and added some comments below on different sections, but this looks like it's coming along great and going in a good direction.
Should this be an optional value? I think if it's not available we're going to run into some complications trying to determine how to check activation status.
I think we should always set the value for this field regardless of the activation method setting. As a developer I would expect this to be the case, and I could debug why the activation method is set as it is separately.
So for this section I would simplify this setter method back to just the assignment and returning `$this`.
Thoughts on simplifying this method out and using a `switch` over the result of `get('activationMethod')` instead? In this format we could have a handler for `manual`, `condition`, and then a default handler for the scenario we don't recognize the result and throw and exception instead?
In the current format if the activation method were set to something like `wheelOfFortune` we would always default to evaluating the conditions with no warning about an invalid configuration being provided.
In the interesting of keeping things modularized and readable it might be worth considering moving the condition evaluation into a separate helper function parallel to the `getManualActivationStatus()` method.
Looking long term this would also set a good precedent in case a new method for determining the activation status were ever introduced.
Anywhere we're passing through translation we need to use `$this->t()` instead of passing to the global function.
Without running the code and debugging it these default values look right. I'm not sure off-hand why the configuration values wouldn't be shown.
For next steps debugging I'd suggest running the export and confirming the new schema values are set as expected.
Nice work adding in the States API configuration. I love the consideration for the editorial UX.
Comment #4
sluceroComment #5
robpowellNext Steps: points 6 and 7.
Comment #6
sluceroThis patch addresses point 6 above by matching the form API field name to the schema API name.
I've also added the same visibility configuration through the States API to the Activation Conditions section.
Comment #7
robpowellLooks good!
Comment #9
sluceroMerged! See commit
f1aade4.