Closed (cannot reproduce)
Project:
Drupal core
Version:
10.1.x-dev
Component:
menu system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
28 Mar 2016 at 17:45 UTC
Updated:
26 Oct 2022 at 04:02 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
rknox commentedComment #3
rknox commentedI ended up doing the following, which seems to be working fine:
menu.html.twig
Comment #4
rknox commentedComment #5
rknox commentedComment #6
mayurjadhav commentedComment #7
mayurjadhav commentedAdded patch with required changes.
Comment #9
easp commentedThe issue is also happening with the local task items. It looks like it needs to be fixed a different was as I don't see the URL value in twig.
Comment #10
wturrell commentedI'm unable to reproduce the original problem in 8.2.x / 8.3.x for anonymous users.
If it's still happening please clarify any steps to reproduce post-install.
Comment #11
ikit-claw commentedTested in chrome chromium and firefox seems to be fixed from 8.2.5+
Comment #12
tstoecklerPer #10 this still needs an issue summary. Also the last patch was tested against 8.1.x and actually failed, so this cannot go in like this.
Comment #13
rachel_norfolkSupport for bug fixes in the 8.1.x minor release finished when 8.2.0 was released. We don't need this bug fix to work on 8.1.x
See https://www.drupal.org/core/release-cycle-overview
An update to the Issue Summary will still be required, though. See https://www.drupal.org/node/1155816
Comment #14
dhansen commentedI'm going to go ahead and close this. I attempted to reproduce the issue as follows given the original version (8.0.5) the issue was reported on:
So between this and the other feedback in #10 I'm going to go ahead and assume there were other factors that did not get noted in the issue. We can certainly get another issue going or reopen this issue provided we get complete instructions to reproduce this in a current version.
Comment #15
jp.stacey commentedWorked on during sprint weekend.
Comment #16
mfbI can reproduce this on FreeBSD, and can fix the bug by disabling the ActiveLinkResponseFilter.
Perhaps there is some platform-specific issue related to LibXML, etc.? Because ActiveLinkResponseFilter is generating very wrong HTML output. This is the markup for main menu on a fresh Drupal 8.3.1 install, anonymous user:
Comment #17
mfbit would appear that on some platforms, the LIBXML_NOEMPTYTAG option is ignored for this line:
$dom->saveXML($node, LIBXML_NOEMPTYTAG);.As a result, the following line removes the
<a>tag, and if we comment this line, the resulting markup is:<a href="/drupal-8.3.1/" data-drupal-link-system-path="<front>" class="is-active"/>Home</a>- note the self-closing<a />tag.So it would appear that to support all platforms, we need to strip out both possibilities:
</a>closing tag or trailing/at the end of the<a />tag.Comment #18
mfbInterestingly, I found that LIBXML_NOEMPTYTAG is ignored by the PHP Apache module, but works on the command-line.
Comment #19
mfbThis patch resolves the issue for me, let's see what testbot thinks.
Comment #20
wturrell commented@mfb - re: #18 – don't suppose you can compare your
php -iCLI output withphpinfo();in the browser and see if that turns up anything obvious?e.g. check "DOM/XML API Version" or "libxml Version"
All my searching has turned up is the introduction of the (first) $node parameter to saveHTML() in PHP 5.3.6, and a couple of projects that have made the same switch you have..
Comment #22
mfb@wturrell I'm using libxml 2.9.4 (with Apache, LibXML, PHP, etc. compiled by FreeBSD ports)
It's not quite that easy to switch from saveXML() to saveHTML(), so here's a different tactic....
Comment #23
mfbI didn't (yet) get any insight from bugs.php.net or IRC as to why LIBXML_NOEMPTYTAG is ignored by PHP apache2handler in my environment (but works on PHP cli). Upstream bug report is at https://bugs.php.net/bug.php?id=74494
Comment #24
wturrell commentedlibxml 2.9.4 for me too (to test with Apache, I'm running it on an Acquia Dev Desktop install which has Apache 2.4.17, I've tried PHP 5.5,5.6 and 7)
Comment #25
mfbIn the end, I was able to resolve this bug in my system with some sysadmin fu (forcibly rebuilding packages and purging old libraries). Perhaps an older version of libxml was used despite PHP reporting 2.9.4?
This patch could still be helpful for anyone else who runs into this obscure issue, though.
Comment #37
mfbThis should be closed again - it turned out to be related to having multiple versions of libxml installed on the system in question.