Closed emmdim closed 8 years ago
It should be fixed now. Can you test and confirm?
Trying to test locally but issue #20 blocks me.
So. according to this image concerning guifi CNML structure, which I think is correct, interfaces can either be children of a device or of a radio. I ran a local test comparing libcnmlv0.9.4, current libcnml and my version. This picture shows the outcome. Long story short, you versions of libcnml recognize the radio 5150 and 5150 both as children of the deivce and the radio while they should be only children of the radio. You get my point? I am not sure what would be the solution the way your code is structured currently but the idea, as I mention in the first post, would be to parse first the radios/interfaces/links and then the interfaces that are alone and then the services.
I think since a long time ago that this is a bug in the CNML generation function from drupal-guifi.
If an interface is already defined in a radio, then it shouldn't appear in the device. Don't you think?
In fact I reported it here: https://github.com/guifi/drupal-guifi/issues/11
Hm. I didn't know. It seems you are correct. So then we just have to wait. Should we leave this thread open for a last when the drupal issue is resolved?
Yes. I'm closing it as it's not a bug in the library but in the format itself.
It seems that many of the interfaces that are not assigned correctly as children of radios. For example you can check the outcome of your tool and this CNML: https://guifi.net/es/guifi/cnml/40309/node So the interface 58373 should be a child of radio 0 according to the CNML, but libcnml presents it as a child of the device 32060 and not of the radio.
I guess it happens both with LXML(tested) and Minidom(not tested). I believe the problem is in the function loadXML (and correspodingly in the loadMinidom function). I changed this function locally to parse first the radios/interfaces/links and then the interfaces that are alone and then the services. This seems to work.