Skip to content

Commit 63deb7d

Browse files
committed
fix(admin): preserve wait dependency config path
1 parent 45d3c6d commit 63deb7d

4 files changed

Lines changed: 19 additions & 8 deletions

File tree

‎.github/copilot-instructions.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ The block is added to the `before_body_end` reference in `basicrum_analytics.xml
102102
- `config.xml`: Module version, models, blocks, helpers, events.
103103
- `system.xml`: Backend configuration fields (ACL, Scope).
104104
- `adminhtml.xml`: Admin menu items and ACL resources.
105-
- Keep Beacon Endpoint URL and BasicRUM Site ID visible while the module is disabled. Runtime-only privacy, wait, and developer fields use cross-group `system.xml` dependencies on `basicrum_analytics/general/enabled`; preserve those dependencies and Magento's scoped inheritance behavior.
105+
- Keep Beacon Endpoint URL and BasicRUM Site ID visible while the module is disabled. Runtime-only privacy, wait, and developer fields use cross-group `system.xml` dependencies on `basicrum_analytics/general/enabled`; preserve those dependencies and Magento's scoped inheritance behavior. The wait toggle uses the unique admin field ID `wait_enabled` with `config_path` mapped to the established public path `basicrum_analytics/wait_after_onload/enabled`, avoiding duplicate dependency node names in Magento's merged XML.
106106

107107
## Important Patterns
108108
- **Helpers**: Always access helpers via `Mage::helper('basicrum_analytics')`.

‎app/code/community/BasicRum/Analytics/etc/system.xml‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,10 +133,11 @@
133133
<show_in_website>1</show_in_website>
134134
<show_in_store>1</show_in_store>
135135
<fields>
136-
<enabled translate="label">
136+
<wait_enabled translate="label">
137137
<label>Enable Wait After Onload</label>
138138
<frontend_type>select</frontend_type>
139139
<source_model>adminhtml/system_config_source_yesno</source_model>
140+
<config_path>basicrum_analytics/wait_after_onload/enabled</config_path>
140141
<sort_order>1</sort_order>
141142
<show_in_default>1</show_in_default>
142143
<show_in_website>1</show_in_website>
@@ -147,7 +148,7 @@
147148
<value>1</value>
148149
</enabled>
149150
</depends>
150-
</enabled>
151+
</wait_enabled>
151152
<wait_ms translate="label">
152153
<label>Wait After Onload (ms)</label>
153154
<frontend_type>text</frontend_type>
@@ -162,7 +163,7 @@
162163
<fieldset>general</fieldset>
163164
<value>1</value>
164165
</enabled>
165-
<enabled>1</enabled>
166+
<wait_enabled>1</wait_enabled>
166167
</depends>
167168
</wait_ms>
168169
</fields>

‎tests/php/run.php‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,13 +231,18 @@ function basicrum_config_dependency_map(SimpleXMLElement $field, $defaultFieldse
231231
);
232232
basicrum_assert_same(
233233
$generalEnabledOnly,
234-
basicrum_config_dependency_map($waitFields->enabled, 'wait_after_onload'),
234+
basicrum_config_dependency_map($waitFields->wait_enabled, 'wait_after_onload'),
235235
'wait control must depend on monitoring being enabled'
236236
);
237+
basicrum_assert_same(
238+
'basicrum_analytics/wait_after_onload/enabled',
239+
(string) $waitFields->wait_enabled->config_path,
240+
'wait control must retain the established public configuration path'
241+
);
237242
basicrum_assert_same(
238243
array(
239244
'general/enabled' => '1',
240-
'wait_after_onload/enabled' => '1',
245+
'wait_after_onload/wait_enabled' => '1',
241246
),
242247
basicrum_config_dependency_map($waitFields->wait_ms, 'wait_after_onload'),
243248
'wait duration must require both enabled monitoring and enabled waiting'

‎tests/platform/verify.php‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,13 +117,18 @@
117117
);
118118
basicrum_platform_assert_same(
119119
$generalEnabledOnly,
120-
basicrum_platform_dependency_map($waitFields->enabled, 'wait_after_onload'),
120+
basicrum_platform_dependency_map($waitFields->wait_enabled, 'wait_after_onload'),
121121
'wait control does not depend on enabled monitoring'
122122
);
123+
basicrum_platform_assert_same(
124+
'basicrum_analytics/wait_after_onload/enabled',
125+
(string) $waitFields->wait_enabled->config_path,
126+
'wait control did not retain its established public configuration path'
127+
);
123128
basicrum_platform_assert_same(
124129
array(
125130
'general/enabled' => '1',
126-
'wait_after_onload/enabled' => '1',
131+
'wait_after_onload/wait_enabled' => '1',
127132
),
128133
basicrum_platform_dependency_map($waitFields->wait_ms, 'wait_after_onload'),
129134
'wait duration dependencies were not preserved by the native config parser'

0 commit comments

Comments
 (0)