How Can I Add Third Party Setting Fields To View?

Created on 21 October 2020, over 4 years ago
Updated 23 May 2023, over 1 year ago

Hi,

I have created configuration view based on "Domain record", an artifact from the Domain Access module.

I can add the standard Domain fields like name. However, we have created several custom fields created using third party settings and none of those show up in the "Add Fields" list.

I'm guessing we will need to write some custom code. Would anyone have any suggestions how we can add those third party settings?

Thank you.

Cheers Brett

✨ Feature request
Status

Active

Version

2.0

Component

User interface

Created by

πŸ‡¦πŸ‡ΊAustralia brettsh

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ͺπŸ‡ΈSpain psf_ Huelva

    +1 for this

  • Open in Jenkins β†’ Open on Drupal.org β†’
    Core: 9.5.x + Environment: PHP 8.0 & MySQL 5.7
    last update over 1 year ago
    2 fail
  • @psf_ opened merge request.
  • πŸ‡ͺπŸ‡ΈSpain psf_ Huelva

    This maybe a start point with some limitations, but functional. I try it with third parties in vocabularies.

  • Status changed to Needs work over 1 year ago
  • πŸ‡ͺπŸ‡ΈSpain psf_ Huelva
  • Issue was unassigned.
  • πŸ‡ͺπŸ‡ΈSpain psf_ Huelva
  • Assigned to psf_
  • πŸ‡ͺπŸ‡ΈSpain psf_ Huelva
  • Open in Jenkins β†’ Open on Drupal.org β†’
    Core: 9.5.x + Environment: PHP 8.0 & MySQL 5.7
    last update over 1 year ago
    2 fail
  • Issue was unassigned.
  • πŸ‡ͺπŸ‡ΈSpain psf_ Huelva
  • Open in Jenkins β†’ Open on Drupal.org β†’
    Core: 9.5.x + Environment: PHP 8.0 & MySQL 5.7
    last update over 1 year ago
    2 fail
  • Open in Jenkins β†’ Open on Drupal.org β†’
    Core: 9.5.x + Environment: PHP 8.0 & MySQL 5.7
    last update over 1 year ago
    1 pass
  • Open in Jenkins β†’ Open on Drupal.org β†’
    Core: 9.5.x + Environment: PHP 8.0 & MySQL 5.7
    last update over 1 year ago
    1 pass
  • First commit to issue fork.
  • Open in Jenkins β†’ Open on Drupal.org β†’
    Core: 9.5.x + Environment: PHP 8.0 & MySQL 5.7
    last update over 1 year ago
    1 pass
  • Open in Jenkins β†’ Open on Drupal.org β†’
    Core: 9.5.x + Environment: PHP 8.0 & MySQL 5.7
    last update over 1 year ago
    1 pass
  • Status changed to Needs review over 1 year ago
  • πŸ‡«πŸ‡·France dydave

    Hi Pedro (@psf_),

    Thanks a lot for the great work on this feature, it's greatly appreciated.

    I would like to confirm successfully testing the changes at #11 from ticket's MR !7 with the following versions :

    • drupal: 10.1.6
    • config_views: 2.1.1

    For testing purpose, I applied the patch directly from gitlab with composer with no issue or error.

    Based on the work that you carried on MR !7, I thought we could perhaps consider integrating feature's logic a bit deeper within module's current logic and therefore created the following merge request :
    https://git.drupalcode.org/project/config_views/-/merge_requests/9

    Probably the most notable change is the inclusion of third_party.* config definitions in module's current logic by changing the regex, see:
    https://git.drupalcode.org/project/config_views/-/merge_requests/9/diffs...

    Otherwise, in terms of separator, I thought we could go for a double underscore (__) straight up (so static) without necessarily defining a constant variable.

    Everything else is pretty much the same as what you've done in your initial merge request.

    Probably one of the good sides of doing it this way is that we're aligning the handling of third party config keys on module's current handling of all other schema keys, allowing to pick up config label and type.

    I have done a bit of testing with a Field View and module Link checker β†’ , which adds third party settings on field configuration entities, see:
    https://git.drupalcode.org/project/linkchecker/-/blob/2.0.x/config/schem...
    to display a view of all the fields on the site with linkchecker's configuration enabled, with sorts and filters (scan and extractor), which seemed to work great and allowed me to confirm it was properly enabled for all the fields that needed it.

    I have tested display of fields, sorting, filtering and everything seemed to work fine (as expected).
     

    At this point, I think the MR is Ready to be reviewed and would greatly appreciate to have your feedback and comments.
    Could you please try giving MR !9 a round of tests and let us know if everything works fine?

    In any case, feel free to let me know if you have any questions, concerns, comments or suggestions on any aspects of this updated MR or the ticket in general, I would surely be very happy to help.
    Once again, thank you very much for all your great ideas and great work on this, it's definitely greatly appreciated.
    Cheers!

  • πŸ‡ΊπŸ‡¦Ukraine andriy khomych

    Short feedback on this issue, I've tested both MR 7 and MR 9 and both are not supporting nested settings.
    Example schema file:

    transaction.type.*.third_party.credits:
      type: mapping
      label: 'Credits settings'
      mapping:
        parent_credit_type_id:
          type: string
          label: 'Parent credit type ID'
        node_types:
          label: 'Node types'
          type: sequence
          sequence:
            label: 'Node type'
            type: string
    

    So, if we have a setting as an array of values, it won't work.

  • πŸ‡ΊπŸ‡¦Ukraine andriy khomych

    It seems connected to Configuration Views (webform) skipping 'sequence' config items πŸ› Configuration Views (webform) skipping 'sequence' config items Active

  • Status changed to Needs work 13 days ago
  • πŸ‡¬πŸ‡§United Kingdom scott_euser

    Thanks for all the contributions to this.

    1. It seems like this contains πŸ› Fix views data field id for boolean Active in it
    2. This needs test coverage

    Out of curiosity, what happens if you try to use a new property in a condition? Does that work?

  • πŸ‡¬πŸ‡§United Kingdom scott_euser

    We should also make sure there is just one branch, so we are rowing in the same direction. At the moment the issue summary shows 3 branches, it is unclear where to focus efforts.

  • πŸ‡ΊπŸ‡¦Ukraine andriy khomych

    I might help with some questions.

    >It seems like this contains #3479204: Fix views data field id for boolean in it
    I can answer this. It has it.

    > Out of curiosity, what happens if you try to use a new property in a condition? Does that work?
    I can answer this. Yup, it works. That's why I like this MR :)

  • πŸ‡«πŸ‡·France dydave

    dydave β†’ changed the visibility of the branch 2.0.x to hidden.

  • πŸ‡«πŸ‡·France dydave

    dydave β†’ changed the visibility of the branch 3178099-how-can-i to hidden.

  • πŸ‡«πŸ‡·France dydave

    Thanks a lot for the feedback!
    Glad to see some interest in this issue!

    #17: All branches and MRs were hidden except MR!9, which seems to have been tested and received some comments at #15.

    #14: Indeed Andriy (@andriy khomych), this initial MR is pretty basic and needs more work to support more complex configuration types, such as mappings and nested settings.

    I was debugging the initial MR while working with the Linkchecker module, which only has flat configuration settings, without any nested settings or more complex configuration types.... and it worked fine (see #13).

    Supporting nested config types would most likely require more work:
    Could you maybe recommend a "simple" contrib module with nested config types that could maybe used for the initial development?

    Otherwise, for tests, we should be able to create a test module with various types of configuration items (including nested), with a view to the test the module and write the Functional test cases to check the page view displays the data as we would expect (Checking the different lines, values, etc...).

    Any help, advice, comments, feedback or contributions would be greatly appreciated.
    Thanks in advance!

  • πŸ‡¬πŸ‡§United Kingdom scott_euser
  • πŸ‡¬πŸ‡§United Kingdom scott_euser

    Okay there is a test sub-module now as a result of other issues. For test coverage, View config could be added there in the config/install folder + programmatic creation of sample content can be done to demonstrate the use of third party settings and test that after the MR they are working as expected.

    If it needs to depend on another module, note that probably another test sub-module needs to be added + composer dependency into require-dev to go with that.

    I pushed the latest from 2.1.x branch into here so at least code is up to date to work from and you can see the existing test coverage.

Production build 0.71.5 2024