Эх сурвалжийг харах

fix(ocmod): replace failing header.php and column_left.php patches

header.php addStyle() call was not found in the live OC3 install;
switch to patching admin/view/template/common/header.twig instead,
searching for </head> which is version-agnostic across all OC3 releases.

column_left.php regex was not matched; replace with a simple literal
search for `if ($sale) {` which appears exactly once in the file
(just before the menu-sale assignment) and is reliable without
whitespace sensitivity.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Benjamin Harris 1 долоо хоног өмнө
parent
commit
514ba53b62
1 өөрчлөгдсөн 13 нэмэгдсэн , 10 устгасан
  1. 13 10
      install.xml

+ 13 - 10
install.xml

@@ -8,17 +8,19 @@
 
 
     <!--
     <!--
         ========================================================================
         ========================================================================
-        FILE: admin/controller/common/header.php
+        FILE: admin/view/template/common/header.twig
 
 
-        Loads reverb.css so the sidebar icon class is defined before the
-        column_left template renders.
+        Loads reverb.css in the <head> so the sidebar icon class is available
+        before column_left renders.  Searching for </head> is version-agnostic
+        across all OC3 minor releases and avoids relying on a specific
+        addStyle() call in the PHP controller.
         ========================================================================
         ========================================================================
     -->
     -->
-    <file path="admin/controller/common/header.php">
+    <file path="admin/view/template/common/header.twig">
         <operation error="skip">
         <operation error="skip">
-            <search><![CDATA[addStyle('view/stylesheet/opencart.css');]]></search>
-            <add position="after"><![CDATA[
-		$this->document->addStyle('view/stylesheet/reverb.css');]]></add>
+            <search><![CDATA[</head>]]></search>
+            <add position="before"><![CDATA[<link href="view/stylesheet/reverb.css" rel="stylesheet" type="text/css">
+]]></add>
         </operation>
         </operation>
     </file>
     </file>
 
 
@@ -27,13 +29,14 @@
         FILE: admin/controller/common/column_left.php
         FILE: admin/controller/common/column_left.php
 
 
         Adds the Reverb menu item to the left-hand navigation, positioned
         Adds the Reverb menu item to the left-hand navigation, positioned
-        above the Sale (menu-sale) block.  A regex search is used so the match
-        is whitespace-agnostic across OC3 minor versions.
+        above the Sale (menu-sale) block.  The literal `if ($sale) {` appears
+        exactly once in OC3 — just before $data['menus'][] is assigned for
+        menu-sale — making it a reliable anchor across all OC3 minor versions.
         ========================================================================
         ========================================================================
     -->
     -->
     <file path="admin/controller/common/column_left.php">
     <file path="admin/controller/common/column_left.php">
         <operation error="skip">
         <operation error="skip">
-            <search regex="true"><![CDATA[if \(\$sale\) \{\s+\$data\['menus'\]\[\]\s*=\s*array\(]]></search>
+            <search><![CDATA[if ($sale) {]]></search>
             <add position="before"><![CDATA[
             <add position="before"><![CDATA[
 		// Reverb
 		// Reverb
 		if ($this->user->hasPermission('access', 'extension/module/reverb')) {
 		if ($this->user->hasPermission('access', 'extension/module/reverb')) {