Smile-SA / magento2-module-store-locator

Magento 2 store locator module
50 stars 57 forks source link

Hidden Dependency to Smile ElasticSuite #160

Open pcs-matze opened 2 months ago

pcs-matze commented 2 months ago

In Module Version 2.2.1 there are system.xml Settings to be added to tabsmile_elasticsuite. If this module is not installed, backend is broken cause tab configuration is missing.

Preconditions

Current Smile Store Locator module without Smile ElasticSuite

Magento Version : 2.4.7

Module Store Locator Version : 2.2.1

Environment : developer

Third party modules : independent

Steps to reproduce

  1. Install Smile Store Locator
  2. Don't install Smile ElasticSuite
  3. Open Backend

Expected result

  1. Backend works well

Actual result

**Backend error:** ![grafik](https://github.com/user-attachments/assets/832c3bfc-3e81-4b92-b224-7d78a29263d6) **Wrong array configuration, id and other information are provided by tab configuration for smile_elasticsuite** ![grafik](https://github.com/user-attachments/assets/79e81678-3c66-4496-b210-3d18935205b2)
emetik commented 2 months ago

@pcs-matze Same issue for me. The etc/adminhtml/system.xml:7 contains a smile_elasticsuite reference that does'nt exists.

The quickfix solution is to add into the system.xml the following lines after the tag and update the reference tab below

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
    <system>

        <section id="store_locator" translate="label" type="text" sortOrder="2020" showInDefault="1" showInWebsite="1" showInStore="1">
            <class>separator-top</class>
            <label>Store Locator Settings</label>
            <tab>smile_store_locator</tab>
            <resource>Magento_Backend::smile_map</resource>

            <group id="search" translate="label" type="text" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1">
                <label>General Settings</label>
                <field id="placeholder" translate="label" type="text" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1">
                    <label>Shown placeholder to help user</label>
                    <comment>default: City, Zipcode, Address ...</comment>
                </field>
            </group>
            <group id="seo" translate="label" type="text" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="1">
                <label>Seo</label>
                <field id="base_url" translate="label" type="text" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1">
                    <label>Store Locator URL</label>
                    <comment>default: stores</comment>
                </field>
            </group>

        </section>

        <section id="smile_map" translate="label" type="text" sortOrder="40" showInDefault="1" showInWebsite="1" showInStore="1">

            <group id="map" translate="label" type="text" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1">
                <field id="provider_osm_copyright_text" translate="label" type="text" sortOrder="90" showInDefault="1" showInWebsite="1" showInStore="1">
                    <label>Copyright text</label>
                    <comment>For example: © OpenStreetMap contributors</comment>
                    <depends>
                        <field id="provider">osm</field>
                    </depends>
                </field>
                <field id="provider_osm_copyright_link" translate="label" type="text" sortOrder="95" showInDefault="1" showInWebsite="1" showInStore="1">
                    <label>Copyright link</label>
                    <comment>For example: https://www.openstreetmap.org/copyright</comment>
                    <depends>
                        <field id="provider">osm</field>
                    </depends>
                </field>
                <field id="provider_all_max_visible_shop" translate="label" type="text" showInDefault="1" showInWebsite="1" showInStore="1" sortOrder="100">
                    <label>Maximum number of visible stores</label>
                    <comment>Above this limit, the list of stores will be not display</comment>
                </field>
            </group>
        </section>
    </system>
</config>