-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Attributes are duplicated multiple nodes #23
Comments
I have updated issue with actual code to reproduce problem. This is the minimal code I managed to get - originaly it was 1000 lines and these are the minimum which are still producing wrong output. |
I am using this fix but I am not sure if it is the best aproach: // Goetas\Twital\Attribute\AttrAttribute.php
public static function getVarname(\DOMNode $node) {
if(!isset($node->uniqueId)) {
$node->uniqueId = '__a9' . md5(uniqid('', true) . spl_object_hash($node));
}
return $node->uniqueId;
} |
Reopening the issue because of 7f34b8a#commitcomment-10900689 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
There is very specific case when attributes from two nodes are merged together. Interesting is that if you remove div with class xxx, it will start working again.
My code:
Expected result:
Actual result:
Both LI and INPUT have display:none but it was defined only for LI.
I looked into php cache of template file a there is the same key used for both nodes (__a9000000006d37f06100007f887925bc9c). My guess is that problem is in spl_object_hash which is used for keys:
When an object is destroyed, its hash may be reused for other objects.
https://php.net/spl_object_hash
The text was updated successfully, but these errors were encountered: