Enable language debug and create a new admin menu item of "Articles > Create an Article" type.
See in menu items list:
**Articles** » **Create An Article**
**Articles** » article
Unrelated
Joomla 3 and 4 affected.
Labels |
Added:
?
|
@infograf768 Are you sure you create a menu item in Administrator menu, not in Site?
Title |
|
Was in site indeed. Should have read better.
In admin, it looks like what you describe is common to all mernu items. Looking into it.
Please test
diff --git a/administrator/components/com_menus/views/items/view.html.php b/administrator/components/com_menus/views/items/view.html.php
index 9b5a07c..b53cd1c 100644
--- a/administrator/components/com_menus/views/items/view.html.php
+++ b/administrator/components/com_menus/views/items/view.html.php
@@ -157,10 +157,23 @@
else
{
- // Get XML file from component folder for standard layouts
- $file = JPATH_SITE . '/components/' . $item->componentname . '/views/' . $vars['view'] . '/tmpl/' . $vars['layout'] . '.xml';
-
- if (!file_exists($file))
+ if ($this->state->get('filter.client_id') == 0)
{
- $file = JPATH_SITE . '/components/' . $item->componentname . '/view/' . $vars['view'] . '/tmpl/' . $vars['layout'] . '.xml';
+ // Get XML file from component folder for standard layouts
+ $file = JPATH_SITE . '/components/' . $item->componentname . '/views/' . $vars['view'] . '/tmpl/' . $vars['layout'] . '.xml';
+
+ if (!file_exists($file))
+ {
+ $file = JPATH_SITE . '/components/' . $item->componentname . '/view/' . $vars['view'] . '/tmpl/' . $vars['layout'] . '.xml';
+ }
+ }
+ else
+ {
+ // Get XML file from administrator component folder for standard layouts
+ $file = JPATH_ADMINISTRATOR . '/components/' . $item->componentname . '/views/' . $vars['view'] . '/tmpl/' . $vars['layout'] . '.xml';
+
+ if (!file_exists($file))
+ {
+ $file = JPATH_ADMINISTRATOR . '/components/' . $item->componentname . '/view/' . $vars['view'] . '/tmpl/' . $vars['layout'] . '.xml';
+ }
}
}
i.e. modify administrator/components/com_menus/views/items/view.html.php
from line 159
from
else
{
// Get XML file from component folder for standard layouts
$file = JPATH_SITE . '/components/' . $item->componentname . '/views/' . $vars['view'] . '/tmpl/' . $vars['layout'] . '.xml';
if (!file_exists($file))
{
$file = JPATH_SITE . '/components/' . $item->componentname . '/view/' . $vars['view'] . '/tmpl/' . $vars['layout'] . '.xml';
}
}
to
else
{
if ($this->state->get('filter.client_id') == 0)
{
// Get XML file from component folder for standard layouts
$file = JPATH_SITE . '/components/' . $item->componentname . '/views/' . $vars['view'] . '/tmpl/' . $vars['layout'] . '.xml';
if (!file_exists($file))
{
$file = JPATH_SITE . '/components/' . $item->componentname . '/view/' . $vars['view'] . '/tmpl/' . $vars['layout'] . '.xml';
}
}
else
{
// Get XML file from administrator component folder for standard layouts
$file = JPATH_ADMINISTRATOR . '/components/' . $item->componentname . '/views/' . $vars['view'] . '/tmpl/' . $vars['layout'] . '.xml';
if (!file_exists($file))
{
$file = JPATH_ADMINISTRATOR . '/components/' . $item->componentname . '/view/' . $vars['view'] . '/tmpl/' . $vars['layout'] . '.xml';
}
}
}
Templates should be checked as well, maybe this after 143:
$base = $this->state->get('filter.client_id') == 0 ? JPATH_SITE : JPATH_ADMINISTRATOR;
// Attempt to load the layout xml file.
// If Alternative Menu Item, get template folder for layout file
if (strpos($vars['layout'], ':') > 0)
{
// Use template folder for layout file
$temp = explode(':', $vars['layout']);
$file = $base . '/templates/' . $temp[0] . '/html/' . $item->componentname . '/' . $vars['view'] . '/' . $temp[1] . '.xml';
// Load template language file
$lang->load('tpl_' . $temp[0] . '.sys', $base, null, false, true)
|| $lang->load('tpl_' . $temp[0] . '.sys', $base . '/templates/' . $temp[0], null, false, true);
}
else
{
// Get XML file from component folder for standard layouts
$file = $base . '/components/' . $item->componentname . '/views/' . $vars['view'] . '/tmpl/' . $vars['layout'] . '.xml';
if (!file_exists($file))
{
$file = $base . '/components/' . $item->componentname . '/view/' . $vars['view'] . '/tmpl/' . $vars['layout'] . '.xml';
}
}
Templates should be checked as well, maybe this after 143:
Yep. Also use $base in my proposal to simplify.
Can you make PR?
I've tried to create this PR as per your instructions stated above. Do let me know your feedback
I did in your PR.
The code is wrong
replace original code
$vars['layout'] = isset($vars['layout']) ? $vars['layout'] : 'default';
// Attempt to load the layout xml file.
// If Alternative Menu Item, get template folder for layout file
if (strpos($vars['layout'], ':') > 0)
{
// Use template folder for layout file
$temp = explode(':', $vars['layout']);
$file = JPATH_SITE . '/templates/' . $temp[0] . '/html/' . $item->componentname . '/' . $vars['view'] . '/' . $temp[1] . '.xml';
// Load template language file
$lang->load('tpl_' . $temp[0] . '.sys', JPATH_SITE, null, false, true)
|| $lang->load('tpl_' . $temp[0] . '.sys', JPATH_SITE . '/templates/' . $temp[0], null, false, true);
}
else
{
// Get XML file from component folder for standard layouts
$file = JPATH_SITE . '/components/' . $item->componentname . '/views/' . $vars['view'] . '/tmpl/' . $vars['layout'] . '.xml';
if (!file_exists($file))
{
$file = JPATH_SITE . '/components/' . $item->componentname . '/view/' . $vars['view'] . '/tmpl/' . $vars['layout'] . '.xml';
}
}
with
$vars['layout'] = isset($vars['layout']) ? $vars['layout'] : 'default';
$base = $this->state->get('filter.client_id') == 0 ? JPATH_SITE : JPATH_ADMINISTRATOR;
// Attempt to load the layout xml file.
// If Alternative Menu Item, get template folder for layout file
if (strpos($vars['layout'], ':') > 0)
{
// Use template folder for layout file
$temp = explode(':', $vars['layout']);
$file = $base . '/templates/' . $temp[0] . '/html/' . $item->componentname . '/' . $vars['view'] . '/' . $temp[1] . '.xml';
// Load template language file
$lang->load('tpl_' . $temp[0] . '.sys', $base, null, false, true)
|| $lang->load('tpl_' . $temp[0] . '.sys', $base . '/templates/' . $temp[0], null, false, true);
}
else
{
// Get XML file from component folder for standard layouts
$file = $base . '/components/' . $item->componentname . '/views/' . $vars['view'] . '/tmpl/' . $vars['layout'] . '.xml';
if (!file_exists($file))
{
$file = $base . '/components/' . $item->componentname . '/view/' . $vars['view'] . '/tmpl/' . $vars['layout'] . '.xml';
}
}
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2021-03-26 08:28:20 |
Closed_By | ⇒ | infograf768 |
Can't reproduce
J4
J3