Problem/Motivation

We are altering a view using hook_views_pre_view to override a view title using contextual filters and some custom logic. This is fired from ViewExecutable::preExecute. Because that hook doesn't get triggered by the metatag module we are getting inconsistent results when trying to generate a metatag title from the contextual filter values.

Steps to reproduce

Override a view title using contextual filters. Alter those contextual filters using hook_views_pre_view and then notice that when generating metatags the contextual filters are not altered.

Proposed resolution

Call ViewExecutable::preExecute

Remaining tasks

N/A

User interface changes

N/A

API changes

N/A

Data model changes

N/A

CommentFileSizeAuthor
#2 3308774_2.patch462 bytesachap

Comments

achap created an issue. See original summary.

achap’s picture

StatusFileSize
new462 bytes
damienmckenna’s picture

Assigned: achap » Unassigned

Thank you for the feature request and providing a patch. I'll take a look at it shortly.

One thing to note - the "assigned" field is for indicating that you're actively working on something, so after uploading the patch please try to remember to change it to "unassigned". Thank you.

  • DamienMcKenna committed 345b4b69 on 8.x-1.x authored by achap
    Issue #3308774 by achap, DamienMcKenna: Allow modules to alter views...

  • DamienMcKenna committed eed7ad2d on 2.0.x authored by achap
    Issue #3308774 by achap, DamienMcKenna: Allow modules to alter views...
damienmckenna’s picture

Title: Allow modules to alter views before building metatags » Allow modules to alter views before building meta tags
Status: Needs review » Fixed
Parent issue: » #3313052: Plan for Metatag 8.x-1.23

Committed. Thank you.

Status: Fixed » Closed (fixed)

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