Skip to content

Commit cd3ca4e

Browse files
committed
fix conflicts
1 parent 80aea00 commit cd3ca4e

File tree

4 files changed

+37
-11
lines changed

4 files changed

+37
-11
lines changed

administrator/language/en-GB/plg_behaviour_compat6.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
PLG_BEHAVIOUR_COMPAT6="Behaviour - Backward Compatibility 6"
77
PLG_COMPAT6_FIELD_CLASSES_ALIASES_DESCRIPTION="Add class aliases for classes which have been renamed or moved to a namespace."
88
PLG_COMPAT6_FIELD_CLASSES_ALIASES_LABEL="Classes Aliases"
9+
PLG_COMPAT6_FIELD_HTML_HELPERS_DESCRIPTION="Activate this option if your extension requires deprecated HTMLHelper classes or functions. When enabled, will provide backward compatibility to the prior major version."
910
PLG_COMPAT6_FIELD_LEGACY_CLASSES_DESCRIPTION="Activate this option if your extension requires previously deprecated classes removed from the current version of Joomla. These removed classes can be found in the folder /plugins/behavior/compat6/classes/."
1011
PLG_COMPAT6_FIELD_LEGACY_CLASSES_LABEL="Include Deprecated Classes"
1112
PLG_COMPAT6_FIELD_REMOVED_ASSETS_DESCRIPTION="Activate this option if your extension requires removed assets which has resulted in an exception. The assets provided are empty but prevent the exception."

plugins/behaviour/compat6/compat6.xml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,18 @@
3434
<option value="0">JNO</option>
3535
<option value="1">JYES</option>
3636
</field>
37+
<field
38+
name="html_helpers"
39+
type="radio"
40+
label="PLG_COMPAT_FIELD_HTML_HELPERS_LABEL"
41+
description="PLG_COMPAT_FIELD_HTML_HELPERS_DESCRIPTION"
42+
layout="joomla.form.field.radio.switcher"
43+
default="1"
44+
filter="integer"
45+
>
46+
<option value="0">JNO</option>
47+
<option value="1">JYES</option>
48+
</field>
3749
<field
3850
name="legacy_classes"
3951
type="radio"
@@ -46,7 +58,6 @@
4658
<option value="0">JNO</option>
4759
<option value="1">JYES</option>
4860
</field>
49-
5061
</fieldset>
5162
</fields>
5263
</config>

plugins/behaviour/compat6/src/Extension/Compat6.php

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
use Joomla\Event\DispatcherInterface;
1616
use Joomla\Event\Priority;
1717
use Joomla\Event\SubscriberInterface;
18-
use Joomla\Plugin\Behaviour\Compat\HTMLHelper\Bootstrap;
1918

2019
// phpcs:disable PSR1.Files.SideEffects
2120
\defined('_JEXEC') or die;
@@ -44,6 +43,7 @@ public static function getSubscribedEvents(): array
4443
*/
4544
return [
4645
'onAfterInitialiseDocument' => ['onAfterInitialiseDocument', Priority::HIGH],
46+
'onAfterRoute' => ['onAfterRoute', Priority::HIGH],
4747
];
4848
}
4949

@@ -100,15 +100,6 @@ public function __construct(DispatcherInterface $dispatcher, array $config = [])
100100
*/
101101
public function onAfterInitialiseDocument(AfterInitialiseDocumentEvent $event)
102102
{
103-
/**
104-
* Load the deprecated HTMLHelper classes/functions
105-
* likely be removed in Joomla 7.0
106-
*/
107-
if ($this->params->get('html_helpers', '1')) {
108-
// Restore HTMLHelper::Bootstrap('framework')
109-
new Bootstrap();
110-
}
111-
112103
/**
113104
* Load the removed assets stubs, they are needed if an extension
114105
* directly uses a core asset from Joomla 5 which is not present in Joomla 6
@@ -121,4 +112,27 @@ public function onAfterInitialiseDocument(AfterInitialiseDocumentEvent $event)
121112
->addRegistryFile('media/plg_behaviour_compat6/removed.asset.json');
122113
}
123114
}
115+
116+
/**
117+
118+
119+
* The after Route logic
120+
*
121+
* @param AfterRouteEvent $event
122+
* @return void
123+
*
124+
* @since __DEPLOY_VERSION__
125+
*/
126+
public function onAfterRoute($event)
127+
{
128+
/**
129+
* Load the deprecated HTMLHelper classes/functions
130+
* likely be removed in Joomla 7.0
131+
*/
132+
if ($this->params->get('html_helpers', '1')) {
133+
// Restore HTMLHelper::Bootstrap('framework')
134+
Factory::getContainer()->get(\Joomla\CMS\HTML\Registry::class)
135+
->register('bootstrap', \Joomla\Plugin\Behaviour\Compat\HTMLHelper\Bootstrap::class, true);
136+
}
137+
}
124138
}
File renamed without changes.

0 commit comments

Comments
 (0)