_datalayer_menu_get_any_object should use the entity for the current route

Created on 14 February 2018, almost 7 years ago
Updated 8 March 2023, over 1 year ago

The function _datalayer_menu_get_any_object() should process parameters in reverse order to get the most specific content entity.

Example:
Group Content Entity Type
Parameters: ['group' => group object, 'group_content' => group_content object]

Results with current code:
The dataLayer is populated with the group object's values.

πŸ› Bug report
Status

Needs review

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States recrit

Live updates comments and jobs are added and updated live.
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.

  • πŸ‡ΊπŸ‡ΈUnited States recrit
  • πŸ‡ΊπŸ‡ΈUnited States recrit

    @blake.thompson correct, this was for the group content path in the form of /group/{group}/content/{group_content}.

    However, reversing the parameters also makes an assumption that the last is the correct entity.
    The attached patch takes a better approach by getting the entity type from the route name and then using that to sniff out the matching route parameter.

    Future Considerations: Allow others to suggest an entity. Example: The group's gnode module could suggest the node referenced by group content instead of the group content entity. The node typically has the metadata needed for the page.

  • πŸ‡ΊπŸ‡ΈUnited States recrit
  • πŸ‡ΊπŸ‡ΈUnited States recrit
Production build 0.71.5 2024