Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(dev/core#594) Fix key-value mappings for WYSIWYG setting (editor_id). Accept keyColumn option. #13361

Merged
merged 2 commits into from
Dec 28, 2018

Conversation

seamuslee001
Copy link
Contributor

@seamuslee001 seamuslee001 commented Dec 27, 2018

Overview

This fixes an issue where by the editor_id setting does not work properly because the javascript and other parts are expecting the string of the name of the Editor whereas in 719eda4#diff-45cac86e3687ecb3e1996985223d2a31 it was changed to keyed on values because that is what is the default for settings pseduoconstants

Before

  • Saving the editor_id in the GUI leads to an invalid setting.
  • In the metadata used for Settings.getoptions in APIv3, one can set an optionGroupName. The key-value mappings are implicitly based on value=>label.

After

  • Saving the editor_id in the GUI leads to a valid setting.
  • In the metadata used for Settings.getoptions in APIv3, one can set an optionGroupName. By default, the key-value mappings are based on value=>label (as before), but one may optionally customize with the keyColumn. This parallels the XML Schema convention that shapes most generic *.getoptions calls.

ping @mattwire @monishdeb @andrewpthompson @MegaphoneJon

@civibot
Copy link

civibot bot commented Dec 27, 2018

(Standard links)

@civibot civibot bot added the 5.9 label Dec 27, 2018
@totten
Copy link
Member

totten commented Dec 28, 2018

(CiviCRM Review Template WORD-1.2)

  • General standards
    • (r-explain):
      • Issue: This does more than just change editor_id handling -- it expands the metadata format for pseudoconstant (to allow a new subkey keyColumn). That should be explained somewhere. (Resolved by updating PR description.)
      • Question: What (if any) steps are required for folks upgrading? Perhaps there's some handful of folks who need to resave the form?
    • (r-user) Pass
    • (r-doc) Pass
    • (r-run) Undecided: Haven't run it yet
  • Developer standards
    • (r-tech) Pass:
      • The main thing going on is that pseudoconstant can now include a keyColumn; the default value, though, is chosen to match the previous hard-coded value. 👍
      • Tangentially, I did a grep to make sure that keyColumn wasn't already used in the metadata. It doesn't appear anywhere in universe/*/settings (incl core's settings/), so that seems safe. 👍
    • (r-code) Pass
    • (r-maint) Pass
    • (r-test) Pass

@seamuslee001
Copy link
Contributor Author

@totten not sure but i used the similar principle as we have in the DAOs https://docs.civicrm.org/dev/en/latest/framework/database/schema-definition/#table-field-pseudoconstant

@totten
Copy link
Member

totten commented Dec 28, 2018

@seamuslee001 Cool, that makes sense -- so it's basically adapting a convention from the DAO/fields metadata to also work in the settings metadata. I'll just update the description so that it reflects that.

@seamuslee001
Copy link
Contributor Author

@totten i'm working on a post upgrade message now. In terms of running it i would check out the test site -> go to the display preferences -> set the editor to be ckeditor -> make sure the configure button is visible -> then after saving the page check a page with a text editor e.g. manage contribution page and check the ckeditor loads.

…e not on value

Add in a post upgrade message encourging people to check their editor setting
@totten totten changed the title dev/core#594 Fix issue where editor_id is expected to be keyed on nam… dev/core#594 Fix key-value mappings for "editor_id" setting Dec 28, 2018
@seamuslee001
Copy link
Contributor Author

@totten added the post upgrade message now

@totten totten changed the title dev/core#594 Fix key-value mappings for "editor_id" setting dev/core#594 Fix key-value mappings for WYSIWYG (editor_id) setting Dec 28, 2018
@totten totten changed the title dev/core#594 Fix key-value mappings for WYSIWYG (editor_id) setting (dev/core#594) Fix key-value mappings for WYSIWYG (editor_id) setting Dec 28, 2018
@andrewpthompson
Copy link
Contributor

@seamuslee001 I've tested this patch and it works as expected.

@seamuslee001
Copy link
Contributor Author

@totten if your happy with the upgrade message i think this is good for merge @monishdeb

@totten
Copy link
Member

totten commented Dec 28, 2018

Thanks @andrewpthompson - that covers the last r-run criterion. 👍

@seamuslee001, I did a little copy-editing on the message. Merge-on-pass.

@seamuslee001
Copy link
Contributor Author

thanks @totten

@totten totten changed the title (dev/core#594) Fix key-value mappings for WYSIWYG (editor_id) setting (dev/core#594) Fix key-value mappings for WYSIWYG setting (editor_id). Accept keyColumn option. Dec 28, 2018
@seamuslee001
Copy link
Contributor Author

Merging as per the tag

@seamuslee001 seamuslee001 merged commit 5862ef4 into civicrm:5.9 Dec 28, 2018
@seamuslee001 seamuslee001 deleted the lab_core_594 branch December 28, 2018 08:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants