Add support for typed data selection

Created on 24 May 2013, almost 12 years ago
Updated 28 March 2023, almost 2 years ago

The attached patch adds TypedDataManager::select(), which can fetch TypedData objects from any typed data hierachy using token-like selectors. This can replace 90% of the token API, and pave the way for Rules 8.x-3.x.

✨ Feature request
Status

Needs work

Version

9.5

Component
Typed dataΒ  β†’

Last updated about 21 hours ago

  • Maintained by
  • πŸ‡¦πŸ‡ΉAustria @fago
Created by

πŸ‡¬πŸ‡§United Kingdom Xano Southampton

Live updates comments and jobs are added and updated live.
  • Needs framework manager review

    It is used to alert the framework manager core committer(s) that an issue significantly impacts (or has the potential to impact) multiple subsystems or represents a significant change or addition in architecture or public APIs, and their signoff is needed (see the governance policy draft for more information). If an issue significantly impacts only one subsystem, use Needs subsystem maintainer review instead, and make sure the issue component is set to the correct subsystem.

  • Needs issue summary update

    Issue summaries save everyone time if they are kept up-to-date. See Update issue summary task instructions.

Sign in to follow issues

Comments & Activities

Not all content is available!

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

  • The Needs Review Queue Bot β†’ tested this issue. It either no longer applies to Drupal core, or fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".

    Apart from a re-roll or rebase, this issue may need more work to address feedback in the issue or MR comments. To progress an issue, incorporate this feedback as part of the process of updating the issue. This helps other contributors to know what is outstanding.

    Consult the Drupal Contributor Guide β†’ to find step-by-step guides for working with issues.

  • Status changed to Needs review about 2 years ago
  • πŸ‡ΊπŸ‡ΈUnited States tr Cascadia

    While this certainly needs to be re-rolled after 8 years, it would be more productive at this point to get some feedback from core committers or other interested parties to hear if there is even any desire or interest to add this feature. Re-rolling at this point is probably just wasted work if no-one is going to even look at it ...

  • πŸ‡§πŸ‡ͺBelgium borisson_ Mechelen, πŸ‡§πŸ‡ͺ

    I agree, rerolling is not helpful here. Added framework manager review tag here - I think that is the right one.

  • Status changed to Needs work about 2 years ago
  • The Needs Review Queue Bot β†’ tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".

    Apart from a re-roll or rebase, this issue may need more work to address feedback in the issue or MR comments. To progress an issue, incorporate this feedback as part of the process of updating the issue. This helps other contributors to know what is outstanding.

    Consult the Drupal Contributor Guide β†’ to find step-by-step guides for working with issues.

  • Status changed to Needs review about 2 years ago
  • πŸ‡«πŸ‡·France nod_ Lille

    per #58

  • πŸ‡«πŸ‡·France nod_ Lille
  • Status changed to Needs work almost 2 years ago
  • πŸ‡¬πŸ‡§United Kingdom catch

    Token is used for a lot of things it shouldn't be, so adding this seems reasonable if we're able to consolidate it properly.

    I think there are two main things:

    1. This needs an issue summary update. What is the next step after this issue? Are there existing places in core it can already be used? How will it replace 90% of token API?

    2. The $selectors parameter is very loose, at the least it could use some examples in the phpdoc.

    +++ b/core/lib/Drupal/Core/TypedData/TypedDataManager.php
    @@ -442,4 +442,55 @@ public function clearCachedDefinitions() {
    +   *
    +   * @param \Drupal\Core\TypedData\ComplexDataInterface|\Drupal\Core\TypedData\ListInterface $data
    +   *   The data to select a descendent property from.
    +   * @param array $selectors
    +   *   An array of strings that identify child properties. These strings can be
    +   *   array keys, or names of object properties, for instance.
    +   *
    

    The docs should give some examples of selectors.

Production build 0.71.5 2024