Uploaded image for project: 'Prestashop 1.6'
  1. Prestashop 1.6
  2. PSCSX-4109

Module installation issue with multistore

    Details

    • Type: Bug
    • Status: Closed
    • Resolution: Fixed
    • Affects Version/s: 1.6.0.9
    • Fix Version/s: None
    • Security Level: All-users
    • Labels:
      None

      Description

      It seems that module installation doesn't work as expected in multishop environment.

      1) install PrestaShop
      2) create 2 shops: "shop A" and "shop B"
      3) create 2 employees: "Employee A" (this employee can only access to "shop A") and "Employee B" (can only access to "shop B")
      4) login in backoffice as "Employee A". Install a module. It works correctly in "shop A"
      5) login in backoffice as "Employee B". The module is installed but not active
      6) Activate the module
      7) The issue is that the module is active, but it's not working properly because no hook is configured for that module in "shop B".

      The problem seems in the registerHook function.
      It calls Shop::getShops() to retrieve all shops so it can register hooks to all shops.
      But Shop::getShops() retrieve only shops that the employee can manage (in this case only "shop A", not "shop B"), so the install process can't hook to "shop B".

      In module install() method, if you call registerHook with an explicit list of shops that contains both "shop A" and "shop B", all works as expected: the module is installed in "shop B" but not active (no hook are called for "shop A" customers). Activating it results in a fully working module.

      Suggestions: Shop::getShops() should retrieve all shops OR registerHook() need another method to retrieve the "true" shop list.

      Regards,

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Gregory Gregory
                Reporter:
                jacky75 jacky75
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: