enable debug mode
Only one debug bar should be present
J4.3.0-rc1 (Atum Template)
I've already found out that it has something to do with the guided tours model
add the mobile status menu
joomla-cms/administrator/templates/atum/html/layouts/status.php
Lines 30 to 38 in 280c0b8
Output:
<div class="header-dd-item dropdown-item" data-item="1">
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<?xml encoding="utf-8" ?>
<html>
<body>
<div class="header-item-content dropdown header-tours d-none d-sm-block">
<button class="dropdown-toggle d-flex align-items-center ps-0 py-0" data-bs-toggle="dropdown" type="button" title="Take a Tour">
<div class="header-item-icon">
<span class="icon-map-signs" aria-hidden="true"></span>
</div>
<div class="header-item-text">
Take a Tour
</div>
<span class="icon-angle-down" aria-hidden="true"></span>
</button>
<div class="dropdown-menu dropdown-menu-end">
<button type="button" class="button-start-guidedtour dropdown-item" data-id="3">
<span class="icon-map-signs" aria-hidden="true"></span>How to create articles?
</button>
[...]
<button type="button" class="dropdown-item text-center" data-bs-toggle="modal" data-bs-target="#modGuidedTours-modal">
Show all tours
</button>
</div>
</div>
</body>
</html>
</div>
As you can see, the div
elements contain a second body
node which probably causes this behavior.
joomla-cms/plugins/system/debug/debug.php
Line 370 in 280c0b8
Labels |
Added:
No Code Attached Yet
|
I cannot reproduce it on php 8.1
What "DOM/XML API Version" and "libxml Version" your php have? Maybe it something from that.
DOM/XML API Version: 20031129
libxml Version: 2.9.14
I found, that it related to DOMDocument behavior https://www.php.net/manual/en/domdocument.savehtml.php#85165
We probably should avoid it here, somehow.
Labels |
Added:
bug
|
@Fedik Yes, that seems to fix the issue. But anyone really understands what we are trying to do with this block of code https://github.com/joomla/joomla-cms/blob/4.3-dev/administrator/templates/atum/html/layouts/status.php#L30-L38 ? In case the a tag is not found, should we add module output to $moduleCollapsedHtml array, something like ?
if ($els->length > 0) {
$moduleCollapsedHtml[] = $dom->saveHTML($els[0]); //$els[0]->nodeValue;
} else {
$moduleCollapsedHtml[] = $out;
}
No, that will not work, or maybe will, no idea :)
That code is extracting bootstrap toggler in this strange way, and skipping it if there is none.
Yes, strange/buggy code. Seems it wants to find a tag which has data-bs-toggle="modal"
. If found, only add a tag to $moduleCollapsedHtml, if not, add the whole module output to $moduleCollapsedHtml array, but who knows :)
Anyway, your code fixed the reported issue. So please make PR.
iirc that is for the mobile views
But anyone really understands what we are trying to do with this block of code
I think it's used for the multilangstatus module ... to not add the $modalHTML twice (normal and collapsed)
joomla-cms/administrator/modules/mod_multilangstatus/tmpl/default.php
Lines 40 to 48 in 280c0b8
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2023-03-25 14:59:26 |
Closed_By | ⇒ | Fedik |
In trying to replicate the issue, all seems alright under PHP 7.4 or 8.0.
All gets loose on PHP 8.1 and higher.
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/40185.