#2688545: Remove ampNodeViewController in favor of amp_entity_view_alter() adds custom cache context services for the 'amp' and 'warnfix' query arguments, because currently Drupal 8 does not provide cache context variations for query arguments with empty values. #2729439: QueryArgsCacheContext should return a special value for ?arg (without value) may fix this upstream in an upcoming 8.1.x release.

Once #2729439: QueryArgsCacheContext should return a special value for ?arg (without value) lands, we can remove the custom cache context services (which are marked as deprecated).

It is not possible at present to set the AMP module to depend upon a certain 8.1.x release, so we will have to decide if we remove the deprecated services once #2729439: QueryArgsCacheContext should return a special value for ?arg (without value) makes it into 8.1.x or if we wait until 8.2 when we could set 8.2 as the minimum core version.

The downside to not setting 8.2 as a dependency is that somebody could be using an older 8.1.x release without #2729439: QueryArgsCacheContext should return a special value for ?arg (without value), which would lead to caching problems where &warnfix would appear to have no effect. (Somebody could use &warnfix=1 to get around this.)

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mdrummond created an issue. See original summary.

mtift’s picture

Status: Active » Postponed
Wim Leers’s picture

RainbowArray’s picture

Status: Active » Postponed

Thanks. Still not available in a point release yet though. Not going to require people use the dev version of D8 for AMP caching to work properly.

Wim Leers’s picture

Of course not. In core, we usually then mark the issue active, to not forget about it again, and because it means it can already land in the next version.

Your project, your decision of course :)

Wim Leers’s picture

Wim Leers’s picture

Title: Remove custom cache context services after QueryArgsCacheContext can handle arguments without values » Remove custom cache context services after QueryArgsCacheContext can handle arguments without values, require Drupal 8.1.2
Wim Leers’s picture

RainbowArray’s picture

This removes the custom cache context services, which are no longer necessary. It's certainly possible somebody could run into an issue if running an older version of 8.1, but that is something that should be avoided anyhow in order to stay up to date on security fixes in core. So I think we should be okay expecting the latest version of 8.1 in order for AMP to function without issue.

RainbowArray’s picture

Status: Active » Needs review
RainbowArray’s picture

To test this, view an AMP-enabled page that has content in the body that needs to be converted to AMP with ?amp, without ?amp and with ?amp&warnfix. The first should have content converted to AMP, the second should not, and the third should have warnings at the bottom of the page. You should not need to do drush cr between page changes.

mtift’s picture

Status: Needs review » Fixed

Looks good! Committed to 8.x-1.x.

Wim Leers’s picture

Yay! Less code!

Status: Fixed » Closed (fixed)

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