Problem/Motivation

My debugger shows this value for $base:

[
"node_field_data"
"#global"
]

The docs don't say that #global is a magic value.

Steps to reproduce

  1. Install Drupal core 11.x in an environment with XDebug
  2. Put a breakpoint in ViewsDataHelper::fetchFields()
  3. Inspect values passed in the debugger and you should find: array("node_field_data", "#global")

Proposed resolution

Update documentation of ViewsDataHelper::fetchFields() to describe the #global value.

Remaining tasks

Create merge request.

User interface changes

None.

API changes

None.

Data model changes

None.

Release notes snippet

None.

Issue fork drupal-3349434

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

joachim created an issue. See original summary.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

peter törnstrand made their first commit to this issue’s fork.

peter törnstrand’s picture

Status: Active » Needs review

Suggestion:

@param array|string $base
  A list or a single base_table, for example 'node'. Pass '#global' to
  return the global Views handlers for the requested $type.
smustgrave’s picture

Status: Needs review » Needs work

Don't see any MR to review. Also summary appears to be incomplete

peter törnstrand’s picture

Issue summary: View changes

peter törnstrand’s picture

Status: Needs work » Needs review
joachim’s picture

@smustgrave for documentation-only issues, I think it's fine to ask for review of proposed text in a comment rather than go through the process of making an MR.

> Pass '#global' to

Nitpick, but I think this conveys that '#global' is an alternative to the string or array of tables. Whereas in fact, it's a magic table value -- as seen in the IS, you can mix it with real tables. So something like:

> The special table name '#global' can be used to [etc]

smustgrave’s picture

ok

joachim’s picture

Status: Needs review » Reviewed & tested by the community

Looks good. Thanks everyone!

catch’s picture

Version: 11.x-dev » 11.3.x-dev
Status: Reviewed & tested by the community » Fixed

Committed/pushed to 11.x and cherry-picked to 11.3.x, thanks!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

  • catch committed 1e5d29c4 on 11.3.x
    fix: #3349434 docs for ViewsDataHelper::fetchFields()  don't explain how...

  • catch committed fd07aa21 on 11.x
    fix: #3349434 docs for ViewsDataHelper::fetchFields()  don't explain how...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.