Skip to content

Multisite Cache problems #4907

@teokolo

Description

@teokolo

Steps to reproduce

  1. Install Magento 2.0.7 or before
  2. Create a second website, store and store view, let's assing the code "website2"
  3. Configure website2 to require vat number on registration:
    config => customers => customer configuration => name and address options => show tax/vat number => REQUIRED (only for website2)

Expected result

  1. Vat number is not required for registering in main website
  2. Vat number is required for registering in website2

Actual result

  1. go to localhost/customer/account/create/ : Vat number is not required in main website
  2. go to localhost/website2/customer/account/create/ : Vat number is not shown in registration form of website2
  3. Clear the cache
  4. Access localhost/website2/customer/account/create/
  5. Vat number is now visible and required for both main website and website2
  6. Clear the cache
  7. Access localhost/customer/account/create/
  8. Vat number is now not visible and not required for both main website and website2.

I'm running multisite in website2 subdirectory.
website2/index.php

<?php
try {
require dirname(__DIR__) . '/app/bootstrap.php';
} catch(\Exception $e) {
    echo <<<HTML
<div style="font:12px/1.35em arial, helvetica, sans-serif;">
    <div style="margin:0 0 25px 0; border-bottom:1px solid #ccc;">
        <h3 style="margin:0;font-size:1.7em;font-weight:normal;text-transform:none;text-align:left;color:#2f2f2f;">
        Autoload error</h3>
    </div>
    <p>{$e->getMessage()}</p>
</div>
HTML;
    exit(1);
}

$params = $_SERVER;
    $params[\Magento\Store\Model\StoreManager::PARAM_RUN_CODE] = 'website2';
    $params[\Magento\Store\Model\StoreManager::PARAM_RUN_TYPE] = 'website';
    $bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $params);
    $app = $bootstrap->createApplication('\Magento\Framework\App\Http');
$bootstrap->run($app);

Both websites are configured to use the same pub directory.

The workaround is disabling "EAV types and attributes" - "Entity types declaration cache".

This issue seems similar to this one: #4556

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions