Skip to content

Fastly module breaks interface contract #466

@ihor-sviziev

Description

@ihor-sviziev

Hi,

This is follow up to the magento/magento2#33468 (comment)

Pre-history: In Magento at some point was delivered a fix for incorrect return type for \Magento\PageCache\Model\Config::getType() in magento/magento2@b59dc72#diff-1281464bcdc813265cb8b0e9822464bd0504743ca81e31b00d46a8b600c9b770R124

Later on, as Magento Cloud using Fastly as CDN provider, this change was partly reverted in magento/magento2@1778c0f, which caused another issue - more details see in magento/magento2#33468.

Root cause analysis shown, that issue coming to the Fastly extension, as it introduced value "fastly" (string) for the method "getType", then converting it to integer (as method designed to return integer) just breaks Fastly extension.

if ($this->config->getType() == Config::FASTLY && $this->config->isEnabled()) {

const FASTLY = 'fastly';

Suggestion:

  1. Change "type" from "fastly" to some integer value
  2. Write a data upgrade script that will convert the old value to new one.

/CC @hostep

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions