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

Pseudoconstants - Fix and improve handling of option callbacks #22730

Merged
merged 3 commits into from
Feb 15, 2022

Commits on Feb 8, 2022

  1. Pseudoconstants - Use id instead of label for name

    Each item in a field option list contains keys like id, name, label, color, icon, description, abbr.
    But some option lists only consist of simple key/value pairs. To convert those simple associative arrays
    into a full option list, the name should be derived from the id, not the label, because machine names
    are expected to be stable, and labels can be translated.
    
    Before: `name` derived from `label` when converting simple associative to an option list
    After: `name` derived from `id`.
    colemanw committed Feb 8, 2022
    Configuration menu
    Copy the full SHA
    79e6ec6 View commit details
    Browse the repository at this point in the history
  2. PseudoConstant - Allow multi-dimensionaly arrays to be returned from …

    …option callbacks
    
    Before: Only flat arrays could be returned by a pseudoconstant callback fn.
    After: Callbacks can return arrays with id/name/label/abbr.
    colemanw committed Feb 8, 2022
    Configuration menu
    Copy the full SHA
    815facd View commit details
    Browse the repository at this point in the history

Commits on Feb 9, 2022

  1. OptionValues - Specify id+name+label for option callbacks that use it

    Previously some API calls relied on a bug which conflated name with label,
    that bug has been fixed, causing some test failures. The solution is to
    update the option lists with a full multidimensional array with translated labels
    and untranslated names.
    colemanw committed Feb 9, 2022
    Configuration menu
    Copy the full SHA
    c44d3d2 View commit details
    Browse the repository at this point in the history